QTimeEdit(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QTimeEdit πŸ’–

okay bestie, this is the manual page for qtimeedit from the 3qt series, aka Qt 3's time-editing widget. she's a whole queen and she's about to explain herself. let's go 🫢


✨ NAME ✨

QTimeEdit β€” Time editor. that's it, that's the vibe. she edits times. πŸ’…


🌸 SYNOPSIS 🌸

#include <qdatetimeedit.h>

Inherits QDateTimeEditBase. so she's got family, she's not out here alone πŸ’œ

πŸ‘‘ Public Members πŸ‘‘

enum Display { Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10
    }
QTimeEdit ( QWidget * parent = 0, const char * name = 0 )
QTimeEdit ( const QTime & time, QWidget * parent = 0, const char * name
    = 0 )
~QTimeEdit ()
QTime time () const
virtual void setAutoAdvance ( bool advance )
bool autoAdvance () const
virtual void setMinValue ( const QTime & d )
QTime minValue () const
virtual void setMaxValue ( const QTime & d )
QTime maxValue () const
virtual void setRange ( const QTime & min, const QTime & max )
QString separator () const
virtual void setSeparator ( const QString & s )
uint display () const
void setDisplay ( uint disp )

πŸŽ€ Public Slots πŸŽ€

virtual void setTime ( const QTime & time )

πŸ¦‹ Signals πŸ¦‹

void valueChanged ( const QTime & time )

⭐ Properties ⭐

  • 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

πŸ’œ Protected Members πŸ’œ

virtual QString sectionFormattedText ( int sec )
virtual void setHour ( int h )
virtual void setMinute ( int m )
virtual void setSecond ( int s )

🌈 DESCRIPTION 🌈

so, the QTimeEdit class provides a time editor. iconic. showstopping. never been done before. (okay maybe it has, but still.)

QTimeEdit lets your user edit times with the keyboard, or with the arrow keys to increase/decrease time values. the arrow keys also move you from section to section inside the QTimeEdit box β€” it's giving little tour guide energy 🧚. and if you want, the user can automatically be moved to the next section once they finish a section, using setAutoAdvance(). times appear in hour, minute, second order. it's recommended that you initialise your QTimeEdit with a time, like this bestie:

QTime timeNow = QTime::currentTime();
QTimeEdit *timeEdit = new QTimeEdit( timeNow, this );
timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) );

so what did we just do? we created a QTimeEdit widget set to the current time. then we set the minimum value to the current time, and the maximum time to one hour from now. slay. βœ…

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 that 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(), and by default the separator is read from the system's settings. no cap.

<center> [Image Omitted]

</center>

See also QTime, QDateEdit, QDateTimeEdit, Advanced Widgets, and Time and Date. πŸ’–

πŸŽ€ Member Type Documentation πŸŽ€

QTimeEdit::Display

this enum defines the sections that comprise a time πŸ•

  • QTimeEdit::Hours β€” The hours section
  • QTimeEdit::Minutes β€” The minutes section
  • QTimeEdit::Seconds β€” The seconds section
  • QTimeEdit::AMPM β€” The AM/PM section

the values can be or'ed together to show any combination. mix and match, it's your moment πŸ’…


πŸ”₯ MEMBER FUNCTION DOCUMENTATION πŸ”₯

QTimeEdit::QTimeEdit ( QWidget * parent = 0, const char * name = 0 )

constructs an empty time edit with parent parent and called name.

QTimeEdit::QTimeEdit ( const QTime & time, 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 time edit with the initial time value time, parent parent and called name. so basically the same but she comes pre-loaded with a time ✨

QTimeEdit::~QTimeEdit ()

destroys the object and frees any allocated resources. rip queen, you did amazing 🫑

bool QTimeEdit::autoAdvance () const

returns TRUE if the editor automatically advances to the next section; otherwise returns FALSE. see the "autoAdvance" property for details.

uint QTimeEdit::display () const

returns the sections that are displayed in the time edit. see the "display" property for details.

QTime QTimeEdit::maxValue () const

returns the maximum time value. see the "maxValue" property for details.

QTime QTimeEdit::minValue () const

returns the minimum time value. see the "minValue" property for details.

QString QTimeEdit::sectionFormattedText ( int sec ) [virtual protected]

returns the formatted number for section sec. this will correspond to either the hour, minute or second section, depending on sec.

QString QTimeEdit::separator () const

returns the editor's separator.

void QTimeEdit::setAutoAdvance ( bool advance ) [virtual]

sets whether the editor automatically advances to the next section to advance. see the "autoAdvance" property for details.

void QTimeEdit::setDisplay ( uint disp )

sets the sections that are displayed in the time edit to disp. see the "display" property for details.

void QTimeEdit::setHour ( int h ) [virtual protected]

sets the hour to h, which must be a valid hour, i.e. in the range 0..24. ⚠️ keep it in range bestie

void QTimeEdit::setMaxValue ( const QTime & d ) [virtual]

sets the maximum time value to d. see the "maxValue" property for details.

void QTimeEdit::setMinValue ( const QTime & d ) [virtual]

sets the minimum time value to d. see the "minValue" property for details.

void QTimeEdit::setMinute ( int m ) [virtual protected]

sets the minute to m, which must be a valid minute, i.e. in the range 0..59.

void QTimeEdit::setRange ( const QTime & min, const QTime & max ) [virtual]

sets the valid input range for the editor to be from min to max inclusive. if min is invalid, no minimum time is set. similarly, if max is invalid, no maximum time is set. she's flexible like that πŸ’

void QTimeEdit::setSecond ( int s ) [virtual protected]

sets the second to s, which must be a valid second, i.e. in the range 0..59.

void QTimeEdit::setSeparator ( const QString & s ) [virtual]

sets the separator to s. note that currently only the first character of s is used. yeah. just the first one. the rest are being ignored and honestly that's a little rude but okay πŸ™ˆ

void QTimeEdit::setTime ( const QTime & time ) [virtual slot]

sets the editor's time value to time. see the "time" property for details.

QTime QTimeEdit::time () const

returns the editor's time value. see the "time" property for details.

void QTimeEdit::valueChanged ( const QTime & time ) [signal]

this signal is emitted whenever the editor's value changes. the time parameter is the new value. πŸ“£ she's telling you!!! listen!!!

πŸ’« Property Documentation πŸ’«

bool autoAdvance

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().

Display display

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().

QTime maxValue

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().

QTime minValue

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().

QTime time

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. like. literally nothing. she just ignores you πŸ’€

set this property's value with setTime() and get this property's value with time().


πŸ¦‹ SEE ALSO πŸ¦‹


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. (no human author, just robot magic ✨)


πŸ’€ 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.

if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qtimeedit.3qt) and the Qt version (3.3.8). πŸ“


okay that's the whole page bestie, you're officially a QTimeEdit scholar now, go forth and edit some times πŸ’…βœ¨

Trolltech AS β€” 2 February 2007 β€” QTimeEdit(3qt) 🫢 that's the footer, mwah, bye!! πŸ’–

πŸ“¦ where this page comes from