replace QTime with QElapsedTimer when possible (qt6)
Since Qt5, some methods of QTime [are deprecated](https://doc.qt.io/qt-5/qtime-obsolete.html). Qt6 remove those methods, thus in two instances we need to use a [QElapsedTimer](https://doc.qt.io/qt-6/qelapsedtimer.html) instead of a QTime. QElapsedTimer is available since Qt5.4, and is already used in the source code.
This commit is contained in:
+1
-1
@@ -177,7 +177,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
updateTimer.setInterval(250);
|
updateTimer.setInterval(250);
|
||||||
updateTimer.start();
|
updateTimer.start();
|
||||||
|
|
||||||
elapsedTime = new QTime;
|
elapsedTime = new QElapsedTimer;
|
||||||
elapsedTime->start();
|
elapsedTime->start();
|
||||||
|
|
||||||
isConnected = false;
|
isConnected = false;
|
||||||
|
|||||||
+1
-1
@@ -137,7 +137,7 @@ private:
|
|||||||
DBCHandler *dbcHandler;
|
DBCHandler *dbcHandler;
|
||||||
QByteArray inputBuffer;
|
QByteArray inputBuffer;
|
||||||
QTimer updateTimer;
|
QTimer updateTimer;
|
||||||
QTime *elapsedTime;
|
QElapsedTimer *elapsedTime;
|
||||||
int framesPerSec;
|
int framesPerSec;
|
||||||
int rxFrames;
|
int rxFrames;
|
||||||
bool inhibitFilterUpdate;
|
bool inhibitFilterUpdate;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define SNIFFERITEM_H
|
#define SNIFFERITEM_H
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QTime>
|
#include <QElapsedTimer>
|
||||||
#include "can_structs.h"
|
#include "can_structs.h"
|
||||||
|
|
||||||
struct fstCan
|
struct fstCan
|
||||||
@@ -50,7 +50,7 @@ private:
|
|||||||
quint64 mCurrentTime;
|
quint64 mCurrentTime;
|
||||||
quint64 mCurrSeqVal;
|
quint64 mCurrSeqVal;
|
||||||
|
|
||||||
QTime mTime;
|
QElapsedTimer mTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SNIFFERITEM_H
|
#endif // SNIFFERITEM_H
|
||||||
|
|||||||
Reference in New Issue
Block a user