summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-03-08 13:20:29 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-14 07:24:38 +0000
commitc7cddc92ffc57b509c03bf4fbbf3cd08ab01eb54 (patch)
tree4b1650a02bbd75c8733fce148f309d3ed2ce86f0
parent494aa933342ec894dc4d1fd533945c6ff41df919 (diff)
QTest::qWaitFor(., int): restore lost Qt::PreciseTimer'ness
Before the qWaitFor() port from int to QDeadlineTimer, the implementation constructed a QDeadlineTimer internally, passing int timeout and Qt::PreciseTimer. The int overload that was retained for source-compatibility, however, constructs the QDeadlineTimer without the PreciseTimer flag, which is a behavior change. Restore the Qt 6.6 behavior and pass Qt::PreciseTimer. Amends fa296ee1dcf4c16fb6f242cf08949485e499fec3. Change-Id: Ib8e5b912c74b70d32a77195edb0d2a30cd7c241d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 73c52ba2687c2035a40141f2a5236399f8331f4b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d9da7c9362363e32d732370d5f340119d6fe9dd5)
-rw-r--r--src/corelib/kernel/qtestsupport_core.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qtestsupport_core.h b/src/corelib/kernel/qtestsupport_core.h
index c5e3858ea8..1507c94783 100644
--- a/src/corelib/kernel/qtestsupport_core.h
+++ b/src/corelib/kernel/qtestsupport_core.h
@@ -62,7 +62,7 @@ qWaitFor(Functor predicate, QDeadlineTimer deadline = QDeadlineTimer(std::chrono
template <typename Functor>
[[nodiscard]] static bool qWaitFor(Functor predicate, int timeout)
{
- return qWaitFor(predicate, QDeadlineTimer(timeout));
+ return qWaitFor(predicate, QDeadlineTimer{timeout, Qt::PreciseTimer});
}
Q_CORE_EXPORT void qWait(int ms);