Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QTimeEdit class provides a time editor. More...
#include <qdatetimeedit.h>
QTimeEdit 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 QTimeEdit 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 QTimeEdit is initialised with a time, e.g.
QTime timeNow = QTime::currentTime(); QTimeEdit *timeEdit = new QTimeEdit( timeNow, this ); timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) );Here we've created a QTimeEdit 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.
See also QTime, QDateEdit, QDateTimeEdit, Advanced Widgets, and Time and Date.
This enum defines the sections that comprise a time
The values can be or'ed together to show any combination.
Constructs a time edit with the initial time value, time, parent parent and called name.
Returns TRUE if the editor automatically advances to the next section; otherwise returns FALSE. See the "autoAdvance" property for details.
Returns the sections that are displayed in the time edit. See the "display" property for details.
Returns the maximum time value. See the "maxValue" property for details.
Returns the minimum time value. See the "minValue" property for details.
Sets whether the editor automatically advances to the next section to advance. See the "autoAdvance" property for details.
Sets the sections that are displayed in the time edit to disp. See the "display" property for details.
Sets the maximum time value to d. See the "maxValue" property for details.
Sets the minimum time value to d. See the "minValue" property for details.
Sets the editor's time value to time. See the "time" property for details.
Returns the editor's time value. See the "time" property for details.
This signal is emitted whenever the editor's value changes. The time parameter is the new value.
This property holds whether the editor automatically advances to the next section.
If autoAdvance is TRUE, the editor will automatically advance focus to the next time section if a user has completed a section. The default is FALSE.
Set this property's value with setAutoAdvance() and get this property's value with autoAdvance().
This property holds the sections that are displayed in the time edit.
The value can be any combination of the values in the Display enum. By default, the widget displays hours, minutes and seconds.
Set this property's value with setDisplay() and get this property's value with display().
This property holds the maximum time value.
Setting the maximum time value is equivalent to calling QTimeEdit::setRange( minValue(), t ), where t is the maximum time. The default maximum time is 23:59:59.
See also minValue and setRange().
Set this property's value with setMaxValue() and get this property's value with maxValue().
This property holds the minimum time value.
Setting the minimum time value is equivalent to calling QTimeEdit::setRange( t, maxValue() ), where t is the minimum time. The default minimum time is 00:00:00.
See also maxValue and setRange().
Set this property's value with setMinValue() and get this property's value with minValue().
This property holds the editor's time value.
When changing the time property, if the time is less than minValue(), or is greater than maxValue(), nothing happens.
Set this property's value with setTime() and get this property's value with time().
This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.
Copyright © 2003 Trolltech | Trademarks | Qt version 3.1.2
|