From a7ba91bd64d821262603c4e62849f7ae6b114ccf Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Feb 2017 08:44:19 -0800 Subject: Use Qt::PreciseTimer for the QDeadlineTimers in QTest::qWait* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDeadlineTimer will eventually support CLOCK_MONOTONIC_COARSE on Linux, so let's be safe before that change appears. Change-Id: I9b423f1b71194205b27afffd14a383a7e9f66a9d Reviewed-by: Stéphane Fabry, Cutesoft Reviewed-by: Allan Sandfeld Jensen --- src/testlib/qtestsystem.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/testlib/qtestsystem.h') diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index b38cd2bdb4..08e240e25a 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -58,7 +58,7 @@ namespace QTest { Q_ASSERT(QCoreApplication::instance()); - QDeadlineTimer timer(ms); + QDeadlineTimer timer(ms, Qt::PreciseTimer); int remaining = ms; do { QCoreApplication::processEvents(QEventLoop::AllEvents, remaining); @@ -74,7 +74,7 @@ namespace QTest #ifdef QT_GUI_LIB inline static bool qWaitForWindowActive(QWindow *window, int timeout = 5000) { - QDeadlineTimer timer(timeout); + QDeadlineTimer timer(timeout, Qt::PreciseTimer); int remaining = timeout; while (!window->isActive() && remaining > 0) { QCoreApplication::processEvents(QEventLoop::AllEvents, remaining); @@ -101,7 +101,7 @@ namespace QTest inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 5000) { - QDeadlineTimer timer(timeout); + QDeadlineTimer timer(timeout, Qt::PreciseTimer); int remaining = timeout; while (!window->isExposed() && remaining > 0) { QCoreApplication::processEvents(QEventLoop::AllEvents, remaining); -- cgit v1.2.3