diff --git a/plugins/robots/common/twoDModel/src/engine/model/timeline.cpp b/plugins/robots/common/twoDModel/src/engine/model/timeline.cpp index 0e3a6cee4a..5a3f870ea4 100644 --- a/plugins/robots/common/twoDModel/src/engine/model/timeline.cpp +++ b/plugins/robots/common/twoDModel/src/engine/model/timeline.cpp @@ -36,6 +36,7 @@ Timeline::Timeline(QObject *parent) } connect(&mTimer, &QTimer::timeout, this, &Timeline::onTimer); + mTimer.setTimerType(Qt::TimerType::PreciseTimer); mTimer.setInterval(defaultRealTimeInterval); } diff --git a/plugins/robots/common/twoDModel/src/engine/twoDModelEngineApi.cpp b/plugins/robots/common/twoDModel/src/engine/twoDModelEngineApi.cpp index c7370232e0..eecf0291cd 100644 --- a/plugins/robots/common/twoDModel/src/engine/twoDModelEngineApi.cpp +++ b/plugins/robots/common/twoDModel/src/engine/twoDModelEngineApi.cpp @@ -352,8 +352,9 @@ void TwoDModelEngineApi::enableBackgroundSceneDebugging() // then NXT and TRIK 2D fake scenes will be shown. QGraphicsView * const fakeScene = new QGraphicsView; fakeScene->setScene(mFakeScene.data()); - QTimer * const timer = new QTimer; + QTimer * const timer = new QTimer(fakeScene); QObject::connect(timer, &QTimer::timeout, &*mFakeScene, [this](){mFakeScene->update();}); + timer->setTimerType(Qt::TimerType::PreciseTimer); timer->setInterval(300); timer->setSingleShot(false); fakeScene->setMinimumWidth(700); diff --git a/plugins/robots/utils/src/realTimer.cpp b/plugins/robots/utils/src/realTimer.cpp index 0736e33c56..b4149cea93 100644 --- a/plugins/robots/utils/src/realTimer.cpp +++ b/plugins/robots/utils/src/realTimer.cpp @@ -18,6 +18,7 @@ using namespace utils; RealTimer::RealTimer() { + mTimer.setTimerType(Qt::TimerType::PreciseTimer); setSingleShot(true); connect(&mTimer, &QTimer::timeout, this, &RealTimer::timeout); }