Q3DateTimeEdit Class Reference |
Q3DateTimeEdit ( QWidget * parent = 0, const char * name = 0 ) | |
Q3DateTimeEdit ( const QDateTime & datetime, QWidget * parent = 0, const char * name = 0 ) | |
~Q3DateTimeEdit () | |
bool | autoAdvance () const |
Q3DateEdit * | dateEdit () |
QDateTime | dateTime () const |
virtual void | setAutoAdvance ( bool advance ) |
Q3TimeEdit * | timeEdit () |
virtual QSize | minimumSizeHint () const |
virtual QSize | sizeHint () const |
virtual void | setDateTime ( const QDateTime & dt ) |
void | valueChanged ( const QDateTime & datetime ) |
virtual void | resizeEvent ( QResizeEvent * event ) |
The Q3DateTimeEdit class combines a Q3DateEdit and Q3TimeEdit widget into a single widget for editing datetimes.
Q3DateTimeEdit consists of a Q3DateEdit and Q3TimeEdit widget placed side by side and offers the functionality of both. The user can edit the date and time by using the keyboard or the arrow keys to increase/decrease date or time values. The Tab key can be used to move from section to section within the Q3DateTimeEdit widget, and the user can be moved automatically when they complete a section using setAutoAdvance(). The datetime can be set with setDateTime().
The date format is read from the system's locale settings. It is set to year, month, day order if that is not possible. See Q3DateEdit::setOrder() to change this. Times appear in the order hours, minutes, seconds using the 24 hour clock.
It is recommended that the Q3DateTimeEdit is initialised with a datetime, e.g.
Q3DateTimeEdit *dateTimeEdit = new Q3DateTimeEdit(QDateTime::currentDateTime(), this); dateTimeEdit->dateEdit()->setRange(QDateTime::currentDate(), QDateTime::currentDate().addDays(7));
Here we've created a new Q3DateTimeEdit set to the current date and time, and set the date to have a minimum date of now and a maximum date of a week from now.
Terminology: A Q3DateEdit widget consists of three 'sections', one each for the year, month and day. Similarly a Q3TimeEdit consists of three sections, one each for the hour, minute and second. The character that separates each date section is specified with setDateSeparator(); similarly setTimeSeparator() is used for the time sections.
See also Q3DateEdit and Q3TimeEdit.
This property holds the editor's datetime value.
The datetime edit's datetime which may be an invalid datetime.
Access functions:
QDateTime | dateTime () const |
virtual void | setDateTime ( const QDateTime & dt ) |
Constructs an empty datetime edit with parent parent and called name.
This is an overloaded function.
Constructs a datetime edit with the initial value datetime, parent parent and called name.
Destroys the object and frees any allocated resources.
Returns true if auto-advance is enabled, otherwise returns false.
See also setAutoAdvance().
Returns the internal widget used for editing the date part of the datetime.
Reimplemented from QWidget::minimumSizeHint().
Reimplemented from QWidget::resizeEvent().
Intercepts and handles the resize event, which hase a special meaning for the Q3DateTimeEdit.
Sets the auto advance property of the editor to advance. If set to true, the editor will automatically advance focus to the next date or time section if the user has completed a section.
See also autoAdvance().
Reimplemented from QWidget::sizeHint().
Returns the internal widget used for editing the time part of the datetime.
This signal is emitted every time the date or time changes. The datetime argument is the new datetime.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6-snapshot | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com