From d0968b6ddf3c6bb78ab282594e383c560dbf8591 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 18 Aug 2023 08:17:20 -0700 Subject: [PATCH] Doc: update QTimer::start() to say that it sets the interval I thought it went without saying... Fixes: QTBUG-116218 Change-Id: I964c2b1e6b834feb9710fffd177c8338f8f1e618 Reviewed-by: Thiago Macieira Reviewed-by: Ahmad Samir (cherry picked from commit 2c86903704413d869131d5ea81951eb8de51639e) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qtimer.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 57cb0c5cd1d..2aafcb4c473 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -200,7 +200,13 @@ void QTimer::start() If the timer is already running, it will be \l{QTimer::stop()}{stopped} and restarted. - If \l singleShot is true, the timer will be activated only once. + If \l singleShot is true, the timer will be activated only once. This is + equivalent to: + + \code + timer.setInterval(msec); + timer.start(); + \endcode \note Keeping the event loop busy with a zero-timer is bound to cause trouble and highly erratic behavior of the UI. @@ -543,7 +549,13 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv If the timer is already running, it will be \l{QTimer::stop()}{stopped} and restarted. - If \l singleShot is true, the timer will be activated only once. + If \l singleShot is true, the timer will be activated only once. This is + equivalent to: + + \code + timer.setInterval(msec); + timer.start(); + \endcode */ /*!