1 /***************************************************************************
2 timespinbox.h - description
4 begin : Sun Mar 31 2002
5 copyright : (C) 2002 by Jason Harris
6 email : kstars@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
22 #include <qstringlist.h>
25 *Custom spinbox to handle selection of timestep values with variable units.
26 *@note this should only be used internally, embedded in a TimeStepBox widget.
31 class TimeSpinBox
: public QSpinBox
{
35 TimeSpinBox( QWidget
*parent
, const char* name
=0 );
36 /**Destructor (empty)*/
39 /**Convert the internal value to a display string.
40 *@note reimplemented from QSpinBox
41 *@p value the internal value to convert to a display string
42 *@return the display string
44 virtual QString
mapValueToText( int value
);
46 /**Convert the displayed string to an internal value.
47 *@note reimplemented from QSpinBox
48 *@p ok bool pointer set to TRUE if conversion was successful
49 *@return internal value converted from displayed text
51 virtual int mapTextToValue( bool *ok
);
53 /**@return the current TimeStep setting */
54 float timeScale() const;
57 void scaleChanged( float s
);
60 void changeScale( float s
);
67 QStringList TimeString
;