summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-06-12 19:30:44 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-13 08:32:51 +0200
commitb367ddfed778ac2f3ce28e39ba83bbe3c1e1437c (patch)
treed6fe2b6f9fca94df39995fe124366c824408b334 /examples
parent14fa4591eb34a35cf3d485fd901e3f1e2caa7770 (diff)
downloadqtsvg-b367ddfed778ac2f3ce28e39ba83bbe3c1e1437c.tar.gz
Convert uses of QTime as a timer to QElapsedTimer
One was an easy replacement, the other changes its reference time, which isn't supported by QElapsedTimer. However, it was easy enough to reimplement in terms of QDateTime::currentMSecsSinceEpoch(); and, as it was previously using QTime as timer, this is presumably good enough (although a proper monotonic timer would be better). Change-Id: I90f8e08635e7d2bc364755efd93fce008b6a62c0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/svg/embedded/fluidlauncher/pictureflow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/svg/embedded/fluidlauncher/pictureflow.cpp b/examples/svg/embedded/fluidlauncher/pictureflow.cpp
index 191ff2e..b0657a2 100644
--- a/examples/svg/embedded/fluidlauncher/pictureflow.cpp
+++ b/examples/svg/embedded/fluidlauncher/pictureflow.cpp
@@ -85,7 +85,7 @@
#include <QTimer>
#include <QVector>
#include <QWidget>
-#include <QTime>
+#include <QElapsedTimer>
#include <QDebug>
@@ -376,7 +376,7 @@ public:
int singlePressThreshold;
QPoint firstPress;
QPoint previousPos;
- QTime previousPosTimestamp;
+ QElapsedTimer previousPosTimestamp;
int pixelDistanceMoved;
int pixelsToMovePerSlide;
@@ -1397,7 +1397,7 @@ void PictureFlow::timerEvent(QTimerEvent* event)
{
if(event->timerId() == d->animateTimer.timerId())
{
-// QTime now = QTime::currentTime();
+// QElapsedTimer now; now.start();
d->updateAnimation();
// d->animateTimer.start(qMax(0, 30-now.elapsed() ), this);
}