QDateTimeEdit(3qt)
π QDateTimeEdit β the QDateTimeEdit(3qt) era, bestie π
okay so welcome to the Qt 3 manual page for QDateTimeEdit, and no cap, this widget is literally the "two snacks in one bag" of date-and-time editing. π
β¨ NAME β¨
QDateTimeEdit β combines a QDateEdit and QTimeEdit widget into a single widget for editing datetimes. it's giving collab of the century. π
πΈ SYNOPSIS πΈ
#include <qdatetimeedit.h>
Inherits QWidget.
π«Ά Public Members
QDateTimeEdit ( QWidget * parent = 0, const char * name = 0 )
QDateTimeEdit ( const QDateTime & datetime, QWidget * parent = 0, const char * name = 0 )
~QDateTimeEdit ()
QDateTime dateTime () const
QDateEdit * dateEdit ()
QTimeEdit * timeEdit ()
virtual void setAutoAdvance ( bool advance )
bool autoAdvance () const
π Public Slots
virtual void setDateTime ( const QDateTime & dt )
π₯ Signals
void valueChanged ( const QDateTime & datetime )
π¦ Properties
QDateTime dateTimeβ the editor's datetime value
π DESCRIPTION π
The QDateTimeEdit class combines a QDateEdit and QTimeEdit widget into a single widget for editing datetimes. two icons, one widget, no drama. β¨
QDateTimeEdit consists of a QDateEdit and QTimeEdit 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 QDateTimeEdit 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 QDateEdit::setOrder() to change this. times appear in the order hours, minutes, seconds using the 24 hour clock. β°
It is recommended that the QDateTimeEdit is initialised with a datetime, e.g.
QDateTimeEdit *dateTimeEdit = new QDateTimeEdit( QDateTime::currentDateTime(), this );
dateTimeEdit->dateEdit()->setRange( QDateTime::currentDate(),
QDateTime::currentDate().addDays( 7 ) );
here we've created a new QDateTimeEdit 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. literally setting boundaries, periodt. π
Terminology: a QDateEdit widget consists of three 'sections', one each for the year, month and day. similarly a QTimeEdit 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.
πΌοΈ (there was an image here in the original β it got omitted, so just picture the cutest little widget screenshot in your head, bestie)
See also QDateEdit, QTimeEdit, Advanced Widgets, and Time and Date. π§
π MEMBER FUNCTION DOCUMENTATION π
QDateTimeEdit::QDateTimeEdit ( QWidget * parent = 0, const char * name = 0 )
Constructs an empty datetime edit with parent parent and called name. blank slate energy. π
QDateTimeEdit::QDateTimeEdit ( const QDateTime & datetime, QWidget * parent = 0, const char * name = 0 )
This is an overloaded member function, provided for convenience. it behaves essentially like the above function.
Constructs a datetime edit with the initial value datetime, parent parent and called name. arriving with lore already. β¨
QDateTimeEdit::~QDateTimeEdit ()
Destroys the object and frees any allocated resources. say bye bestie, it's a clean exit. π
bool QDateTimeEdit::autoAdvance () const
Returns TRUE if auto-advance is enabled, otherwise returns FALSE.
See also setAutoAdvance().
QDateEdit * QDateTimeEdit::dateEdit ()
Returns the internal widget used for editing the date part of the datetime. the date half of the duo. ποΈ
QDateTime QDateTimeEdit::dateTime () const
Returns the editor's datetime value. see the "dateTime" property for details.
void QDateTimeEdit::setAutoAdvance ( bool advance ) [virtual]
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. it's basically a "you finished? moving on, slay" button. π
void QDateTimeEdit::setDateTime ( const QDateTime & dt ) [virtual slot]
Sets the editor's datetime value to dt. see the "dateTime" property for details.
QTimeEdit * QDateTimeEdit::timeEdit ()
Returns the internal widget used for editing the time part of the datetime. the clock half, the other icon. β³
void QDateTimeEdit::valueChanged ( const QDateTime & datetime ) [signal]
This signal is emitted every time the date or time changes. the datetime argument is the new datetime. not me getting notified on every single little change ππ
π Property Documentation π
QDateTime dateTime
This property holds the editor's datetime value.
The datetime edit's datetime which may be an invalid datetime. (yes, it can be invalid, that's not a typo, bestie, that's just how it is.)
Set this property's value with setDateTime() and get this property's value with dateTime().
β SEE ALSO β
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
πΈ AUTHOR πΈ
Generated automatically from the source code. (the author is a script, and honestly? it ate. π€β¨)
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (fr fr, it's a side quest.)
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdatetimeedit.3qt) and the Qt version (3.3.8). π
and that's the whole page, bestie β go forth and edit some datetimes, you absolute icon πβ¨
Trolltech AS Β· 2 February 2007 Β· Qt 3.3.8 β mwah, this page is officially closed, no cap. ππ
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms