mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Use QElapsedTimer instead of QTime
This commit is contained in:
@ -26,6 +26,8 @@
|
||||
|
||||
#include "pictureflow.h"
|
||||
|
||||
#include <QElapsedTimer>
|
||||
|
||||
// detect Qt version
|
||||
#if QT_VERSION >= 0x040000
|
||||
#define PICTUREFLOW_QT4
|
||||
@ -1281,8 +1283,8 @@ void PictureFlow::resizeEvent(QResizeEvent *event)
|
||||
#include <QTime>
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user