Logo Search packages:      
Sourcecode: qtodo version File versions  Download package

QTodoTimeEdit Class Reference

Inheritance diagram for QTodoTimeEdit:


List of all members.

Detailed Description

The QTodoTimeEdit class provides a time editor.

QTodoTimeEdit allows the user to edit times by using the keyboard or the arrow keys to increase/decrease time values. The arrow keys can be used to move from section to section within the QTodoTimeEdit box. The user can automatically be moved to the next section once they complete a section using setAutoAdvance(). Times appear in hour, minute, second order. It is recommended that the QTodoTimeEdit is initialised with a time, e.g.

    QTime timeNow = QTime::currentTime();
    QTodoTimeEdit *timeEdit = new QTodoTimeEdit( timeNow, this );
    timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) );
Here we've created a QTodoTimeEdit widget set to the current time. We've also set the minimum value to the current time and the maximum time to one hour from now.

The maximum and minimum values for a time value in the time editor default to the maximum and minimum values for a QTime. You can change this by calling setMinValue(), setMaxValue() or setRange().

Terminology: A QTimeWidget consists of three sections, one each for the hour, minute and second. You can change the separator character using setSeparator(), by default the separator is read from the system's settings.

datetimewidgets.png Date Time Widgets

See also:
QTime QTodoDateEdit QTodoDateTimeEdit

Definition at line 182 of file qtodo_datetimeedit.h.

Public Types

enum  Display { Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10 }

Public Slots

virtual void setTime (const QTime &time)


void oldValueChanged (const QTime &time)
void valueChanged (const QTime &time)

Public Member Functions

bool autoAdvance () const
uint display () const
QTime maxValue () const
QSize minimumSizeHint () const
QTime minValue () const
 QTodoTimeEdit (const QTime &time, QWidget *parent=0, const char *name=0)
 QTodoTimeEdit (QWidget *parent=0, const char *name=0)
void removeFirstNumber (int sec)
QString separator () const
virtual void setAutoAdvance (bool advance)
void setDisplay (uint disp)
void setFocusInTime (const QTime &time)
virtual void setMaxValue (const QTime &d)
virtual void setMinValue (const QTime &d)
virtual void setRange (const QTime &min, const QTime &max)
virtual void setSeparator (const QString &s)
QSize sizeHint () const
QTime time () const
 ~QTodoTimeEdit ()

Protected Slots

void updateButtons ()

Protected Member Functions

void addNumber (int sec, int num)
bool event (QEvent *e)
virtual bool outOfRange (int h, int m, int s) const
void removeLastNumber (int sec)
void resizeEvent (QResizeEvent *)
QString sectionFormattedText (int sec)
bool setFocusSection (int s)
virtual void setHour (int h)
virtual void setMinute (int m)
virtual void setSecond (int s)
void stepDown ()
void stepUp ()
void timerEvent (QTimerEvent *e)


bool autoAdvance
 whether the editor automatically advances to the next section
Display display
 the sections that are displayed in the time edit
QTime maxValue
 the maximum time value
QTime minValue
 the minimum time value
QTime time
 the editor's time value.

Private Slots

void slotFocusInSignal ()
void slotFocusOutSignal ()

Private Member Functions

void init ()
QTodoTimeEditoperator= (const QTodoTimeEdit &)
 QTodoTimeEdit (const QTodoTimeEdit &)
QString sectionText (int sec)

Private Attributes

QTodoTimeEditPrivate * d
QTime focus_in_time
int m_spin_width

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index