diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp index 4e15b3b80f8..731ff4e9e11 100644 --- a/src/corelib/kernel/qdeadlinetimer.cpp +++ b/src/corelib/kernel/qdeadlinetimer.cpp @@ -131,10 +131,12 @@ static qint64 add_saturate(qint64 t1, Duration1 dur, Durations... extra) */ /*! + \fn QDeadlineTimer::QDeadlineTimer() \fn QDeadlineTimer::QDeadlineTimer(Qt::TimerType timerType) Constructs an expired QDeadlineTimer object. For this object, - remainingTime() will return 0. + remainingTime() will return 0. If \a timerType is not set, then the object + will use the \l{Qt::CoarseTimer}{coarse} \l{QDeadlineTimer#Timer types}{timer type}. The timer type \a timerType may be ignored, since the timer is already expired. Similarly, for optimization purposes, this function will not diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h index b872422add0..57c771de9a2 100644 --- a/src/corelib/kernel/qdeadlinetimer.h +++ b/src/corelib/kernel/qdeadlinetimer.h @@ -26,7 +26,8 @@ public: enum class ForeverConstant { Forever }; static constexpr ForeverConstant Forever = ForeverConstant::Forever; - constexpr QDeadlineTimer(Qt::TimerType type_ = Qt::CoarseTimer) noexcept + constexpr QDeadlineTimer() noexcept = default; + constexpr explicit QDeadlineTimer(Qt::TimerType type_) noexcept : type(type_) {} constexpr QDeadlineTimer(ForeverConstant, Qt::TimerType type_ = Qt::CoarseTimer) noexcept : t1((std::numeric_limits::max)()), type(type_) {} @@ -142,7 +143,7 @@ private: #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) unsigned t2 = 0; #endif - unsigned type; + unsigned type = Qt::CoarseTimer; qint64 rawRemainingTimeNSecs() const noexcept; };