diff --git a/common/pictureflow.cpp b/common/pictureflow.cpp index 893f8883..4e552a50 100644 --- a/common/pictureflow.cpp +++ b/common/pictureflow.cpp @@ -26,6 +26,8 @@ #include "pictureflow.h" +#include + // detect Qt version #if QT_VERSION >= 0x040000 #define PICTUREFLOW_QT4 @@ -1281,8 +1283,8 @@ void PictureFlow::resizeEvent(QResizeEvent *event) #include void PictureFlow::updateAnimation() // bucle principal { - QTime now; - now.start(); + QElapsedTimer timer; + timer.start(); bool frameSkiped = false; int old_center = d->state->centerIndex; @@ -1297,7 +1299,7 @@ void PictureFlow::updateAnimation() // bucle principal if (d->state->centerIndex != old_center) emit centerIndexChangedSilent(d->state->centerIndex); if (d->animator->animating == true) { - int difference = 10 - now.elapsed(); + int difference = 10 - timer.elapsed(); if (difference >= 0 && !frameSkiped) QTimer::singleShot(difference, this, &PictureFlow::updateAnimation); else { diff --git a/common/scroll_management.cpp b/common/scroll_management.cpp index 8b4674f4..0fdd5dbc 100644 --- a/common/scroll_management.cpp +++ b/common/scroll_management.cpp @@ -2,7 +2,7 @@ ScrollManagement::ScrollManagement() { - wheelTimer = new QTime(); + wheelTimer = new QElapsedTimer(); wheelTimer->start(); wheelAccumulator = 0; } diff --git a/common/scroll_management.h b/common/scroll_management.h index 3ed9185d..f7cd362a 100644 --- a/common/scroll_management.h +++ b/common/scroll_management.h @@ -1,7 +1,7 @@ #ifndef SCROLLMANAGAMENT_H #define SCROLLMANAGAMENT_H -#include +#include #include class ScrollManagement @@ -18,7 +18,7 @@ public: ~ScrollManagement(); private: - QTime *wheelTimer; + QElapsedTimer *wheelTimer; int wheelAccumulator; };