Adjust to QUnifiedTimer slow mode changes

a318e331f1387eb3c9d13be96c28619453a35571 in qtbase.

Task-number: QTBUG-137919
Change-Id: I98e3871053bbb04b83aa114844f07293501d95d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Mitch Curtis 2025-06-24 13:04:06 +08:00
parent 8c6eda1e67
commit 182bb9d04d
4 changed files with 4 additions and 6 deletions

View File

@ -306,8 +306,7 @@ void GlobalInspector::processMessage(const QByteArray &message)
} else if (command == SET_ANIMATION_SPEED) { } else if (command == SET_ANIMATION_SPEED) {
qreal speed; qreal speed;
ds >> speed; ds >> speed;
QUnifiedTimer::instance()->setSlowModeEnabled(speed != 1.0); QUnifiedTimer::instance()->setSpeedModifier(1 / speed);
QUnifiedTimer::instance()->setSlowdownFactor(speed);
} else if (command == SHOW_APP_ON_TOP) { } else if (command == SHOW_APP_ON_TOP) {
bool showOnTop; bool showOnTop;
ds >> showOnTop; ds >> showOnTop;

View File

@ -296,8 +296,7 @@ void QQuickDesignerSupportItems::disableBehaivour(QObject *object)
void QQuickDesignerSupportItems::stopUnifiedTimer() void QQuickDesignerSupportItems::stopUnifiedTimer()
{ {
QUnifiedTimer::instance()->setSlowdownFactor(0.00001); QUnifiedTimer::instance()->setSpeedModifier(0);
QUnifiedTimer::instance()->setSlowModeEnabled(true);
} }
void QQuickDesignerSupportItems::registerFixResourcePathsForObjectCallBack(void (*callback)(QObject *)) void QQuickDesignerSupportItems::registerFixResourcePathsForObjectCallBack(void (*callback)(QObject *))

View File

@ -559,7 +559,7 @@ int main(int argc, char *argv[])
} }
#if QT_CONFIG(qml_animation) #if QT_CONFIG(qml_animation)
if (parser.isSet(slowAnimationsOption)) if (parser.isSet(slowAnimationsOption))
QUnifiedTimer::instance()->setSlowModeEnabled(true); QUnifiedTimer::instance()->setSpeedModifier(0.2);
if (parser.isSet(fixedAnimationsOption)) if (parser.isSet(fixedAnimationsOption))
QUnifiedTimer::instance()->setConsistentTiming(true); QUnifiedTimer::instance()->setConsistentTiming(true);
#endif #endif

View File

@ -537,7 +537,7 @@ int main(int argc, char ** argv)
QQuickWindow::setTextRenderType(options.textRenderType); QQuickWindow::setTextRenderType(options.textRenderType);
QUnifiedTimer::instance()->setSlowModeEnabled(options.slowAnimations); QUnifiedTimer::instance()->setSpeedModifier(options.slowAnimations ? 0.2 : 1);
if (options.rhi) { if (options.rhi) {
if (options.rhiBackendSet) if (options.rhiBackendSet)