![]() |
| ||
Classes - Annotated - Tree - Functions - Home - Structure |
The QTimeEdit class provides a time editor. More...
#include <qdatetimeedit.h>
Inherits QDateTimeEditBase.
The QTimeEdit class provides a time editor.
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. Times appear in hour, minute, second order by default, but . It is recommended that the QTimeEdit be 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.
See also QDateEdit and QDateTimeEdit.
Constructs a time edit with the initial value time, parent parent and name name.
The time edit is initialized with time.
Returns TRUE whether the editor automatically advances to the next entry field, otherwise returns FALSE. See the "autoAdvance" 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.
Reimplemented from QDateTimeEditBase.
Sets whether the editor automatically advances to the next entry field to advance. See the "autoAdvance" 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 time value of the editor to time. See the "time" property for details.
Returns the time value of the editor. 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 entry field.
If autoAdvance is TRUE, the editor will automatically advance focus to the next time section if a user has completed a section.
Set this property's value with setAutoAdvance() and get this property's value with autoAdvance().
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.
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.
Set this property's value with setMinValue() and get this property's value with minValue().
This property holds the time value of the editor.
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().
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright © 2000 Trolltech | Trademarks | Qt version main-beta1
|