Obsolete Members for QBasicTimer
The following members of class QBasicTimer are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.
Public Functions
(since 6.5, deprecated) void | start(int duration, QObject *object) |
(since 6.5, deprecated) void | start(int msec, Qt::TimerType timerType, QObject *obj) |
(deprecated) int | timerId() const |
Member Function Documentation
[since 6.5, deprecated] void QBasicTimer::start(int duration, QObject *object)
This function is deprecated. We strongly advise against using it in new code.
Starts (or restarts) the timer with a duration timeout. The timer will be a Qt::CoarseTimer. See Qt::TimerType for information on the different timer types.
The given object will receive timer events.
Starting from Qt 6.10, setting a negative interval will result in a run-time warning and the value being reset to 1ms. Before Qt 6.10 a Qt Timer would let you set a negative interval but behave in surprising ways (for example stop the timer if it was running or not start it at all).
Note: Starting from Qt 6.9 this method takes std::chrono::nanoseconds, before that it took std::chrono::milliseconds. This change is backwards compatible.
This function was introduced in Qt 6.5.
See also stop(), isActive(), QObject::timerEvent(), and Qt::CoarseTimer.
[since 6.5, deprecated] void QBasicTimer::start(int msec, Qt::TimerType timerType, QObject *obj)
This function is deprecated. We strongly advise against using it in new code.
Use chrono overload instead.
This is an overloaded function.
This function was introduced in Qt 6.5.
[noexcept, deprecated] int QBasicTimer::timerId() const
This function is deprecated. We strongly advise against using it in new code.
Returns the timer's ID.
In new code use id() instead.
See also QTimerEvent::timerId().