summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestsystem.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-02-15 08:44:19 -0800
committerThiago Macieira <thiago.macieira@intel.com>2017-02-15 19:04:21 +0000
commita7ba91bd64d821262603c4e62849f7ae6b114ccf (patch)
tree45ce15609bd9fa7a81955ffe551dbf03da14fbb5 /src/testlib/qtestsystem.h
parentfb376e0fcc8d2d0a1731a588bfc6497d05e090e6 (diff)
Use Qt::PreciseTimer for the QDeadlineTimers in QTest::qWait*
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 <stephane.fabry@gmail.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/testlib/qtestsystem.h')
-rw-r--r--src/testlib/qtestsystem.h6
1 files changed, 3 insertions, 3 deletions
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);