The QTimer class provides a high-level programming interface for
timers. To use it, create a QTimer, connect its timeout() signal
- to the appropriate slots, and call start(). From then on it will
+ to the appropriate slots, and call start(). From then on, it will
emit the timeout() signal at constant intervals.
Example for a one second (1000 millisecond) timer (from the
\snippet timers/timers.cpp 5
\snippet timers/timers.cpp 6
- \c processOneThing() will from then on be called repeatedly. It
+ From then on, \c processOneThing() will be called repeatedly. It
should be written in such a way that it always returns quickly
(typically after processing one data item) so that Qt can deliver
- events to widgets and stop the timer as soon as it has done all
+ events to the user interface and stop the timer as soon as it has done all
its work. This is the traditional way of implementing heavy work
- in GUI applications; multithreading is now becoming available on
- more and more platforms, and we expect that zero-millisecond
+ in GUI applications, but as multithreading is nowadays becoming available on
+ more and more platforms, we expect that zero-millisecond
QTimers will gradually be replaced by \l{QThread}s.
\section1 Accuracy and Timer Resolution
disadvantage is that timerEvent() does not support such
high-level features as single-shot timers or signals.
- Another alternative to using QTimer is to use QBasicTimer. It is
- typically less cumbersome than using QObject::startTimer()
+ Another alternative is QBasicTimer. It is typically less
+ cumbersome than using QObject::startTimer()
directly. See \l{Timers} for an overview of all three approaches.
Some operating systems limit the number of timers that may be
today's date, and restricted the valid date range to today plus or
minus 365 days. We've set the order to month, day, year.
- The minimum value for QDateTimeEdit is 14 September 1752,
- and 2 January 4713BC for QDate. You can change this by calling
- setMinimumDate(), setMaximumDate(), setMinimumTime(),
+ The minimum value for QDateTimeEdit is 14 September 1752. You can
+ change this by calling setMinimumDate(), taking into account that
+ the minimum value for QDate is 2 January 4713BC.
+
+ Other useful functions are setMaximumDate(), setMinimumTime()
and setMaximumTime().
\section1 Using a Pop-up Calendar Widget
\brief the current section index of the spinbox
- If the format is 'yyyy/MM/dd', the displayText is '2001/05/21' and
- the cursorPosition is 5 currentSectionIndex returns 1. If the
- cursorPosition is 3 currentSectionIndex is 0 etc.
+ If the format is 'yyyy/MM/dd', the displayText is '2001/05/21', and
+ the cursorPosition is 5, currentSectionIndex returns 1. If the
+ cursorPosition is 3, currentSectionIndex is 0, and so on.
\a setCurrentSection()
\sa currentSection()
\since 4.2
Selects \a section. If \a section doesn't exist in the currently
- displayed sections this function does nothing. If \a section is
- NoSection this function will unselect all text in the editor.
- Otherwise this function will move the cursor and the current section
+ displayed sections, this function does nothing. If \a section is
+ NoSection, this function will unselect all text in the editor.
+ Otherwise, this function will move the cursor and the current section
to the selected section.
\sa currentSection()
\brief the format used to display the time/date of the date time edit
- This format is the same as the one used described in QDateTime::toString()
- and QDateTime::fromString()
+ This format is described in QDateTime::toString() and QDateTime::fromString()
Example format strings (assuming that the date is 2nd of July 1969):
/*!
\property QDateTimeEdit::calendarPopup
- \brief the current calendar pop-up showing mode.
+ \brief the current calendar pop-up show mode.
\since 4.2
The calendar pop-up will be shown upon clicking the arrow button.
\inmodule QtWidgets
Many of the properties and functions provided by QTimeEdit are implemented in
- QDateTimeEdit. The following properties are most relevant to users of this
- class:
+ QDateTimeEdit. These are the relevant properties of this class:
\list
- \li \l{QDateTimeEdit::time}{time} holds the date displayed by the widget.
+ \li \l{QDateTimeEdit::time}{time} holds the time displayed by the widget.
\li \l{QDateTimeEdit::minimumTime}{minimumTime} defines the minimum (earliest) time
that can be set by the user.
\li \l{QDateTimeEdit::maximumTime}{maximumTime} defines the maximum (latest) time
\inmodule QtWidgets
Many of the properties and functions provided by QDateEdit are implemented in
- QDateTimeEdit. The following properties are most relevant to users of this
- class:
+ QDateTimeEdit. These are the relevant properties of this class:
\list
\li \l{QDateTimeEdit::date}{date} holds the date displayed by the widget.