From 84e89c1e9e00d4fab576b876cfa80e92b5602982 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 12 Jun 2019 18:06:23 +0200 Subject: Convert uses of QTime as a timer to QElapsedTimer Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint --- tests/auto/opengl/qglthreads/tst_qglthreads.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'tests/auto/opengl/qglthreads') diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index b7b5b505a0..8a38d0f517 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "tst_qglthreads.h" #ifndef QT_OPENGL_ES_2 @@ -74,9 +75,9 @@ public: } void run() { - QTime time; - time.start(); - while (time.elapsed() < RUNNING_TIME) { + QElapsedTimer timer; + timer.start(); + while (timer.elapsed() < RUNNING_TIME) { lock(); waitForReadyToSwap(); @@ -291,11 +292,11 @@ public: } void run() { - QTime time; - time.start(); + QElapsedTimer timer; + timer.start(); failure = false; - while (time.elapsed() < RUNNING_TIME && !failure) { + while (timer.elapsed() < RUNNING_TIME && !failure) { m_widget->makeCurrent(); @@ -466,13 +467,13 @@ public: public slots: void draw() { bool beginFailed = false; - QTime time; - time.start(); + QElapsedTimer timer; + timer.start(); int rotAngle = 10; device->prepareDevice(); QPaintDevice *paintDevice = device->realPaintDevice(); QSize s(paintDevice->width(), paintDevice->height()); - while (time.elapsed() < RUNNING_TIME) { + while (timer.elapsed() < RUNNING_TIME) { QPainter p; if (!p.begin(paintDevice)) { beginFailed = true; -- cgit v1.2.3