From dd5925fedb19c8fdb2601ec9eab6fb916341ff47 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 12 Mar 2024 08:29:06 +0100 Subject: [PATCH] QTest::qWaitFor: make a comment terser ...and adjust it to its presence in the new QDeadlineTimer overload, which sports nanoseconds granularity. Pick-to: 6.7 Change-Id: Ifa9658ca32c5dc4bef5cf36dec2e452174eebe1c Reviewed-by: Ahmad Samir Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtestsupport_core.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qtestsupport_core.h b/src/corelib/kernel/qtestsupport_core.h index 5e7d5dd3f3..33f36f9cbf 100644 --- a/src/corelib/kernel/qtestsupport_core.h +++ b/src/corelib/kernel/qtestsupport_core.h @@ -23,9 +23,8 @@ qWaitFor(Functor predicate, QDeadlineTimer deadline = QDeadlineTimer(std::chrono if (predicate()) return true; - // qWait() is expected to spin the event loop, even when called with a small - // timeout like 1ms, so we we can't use a simple while-loop here based on - // the deadline timer not having timed out. Use do-while instead. + // qWait() is expected to spin the event loop at least once, even when + // called with a small timeout like 1ns. using namespace std::chrono;