diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-10 23:48:18 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-10 23:50:08 (GMT) |
commit | 7c4287c9c36bf5382799eac6f6ceb97d4cec3f6f (patch) | |
tree | 1a1fe05589bcef1315e37db2859ba1823fec793f /tools/qmlviewer/qmlviewer.cpp | |
parent | 2133c9c454b8a648aad2a1993b3e239ceeeca03b (diff) | |
download | Qt-7c4287c9c36bf5382799eac6f6ceb97d4cec3f6f.zip Qt-7c4287c9c36bf5382799eac6f6ceb97d4cec3f6f.tar.gz Qt-7c4287c9c36bf5382799eac6f6ceb97d4cec3f6f.tar.bz2 |
Add ability for viewer to slow down animations.
This is useful for debugging complex transitions.
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index b6a3627..ea0936b 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -413,6 +413,16 @@ void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu) if (flatmenu) flatmenu->addSeparator(); + QMenu *debugMenu = flatmenu ? flatmenu->addMenu(tr("&Debugging")) : menu->addMenu(tr("&Debugging")); + + QAction *slowAction = new QAction(tr("&Slow Down Animations"), parent); + slowAction->setShortcut(QKeySequence("Ctrl+.")); + slowAction->setCheckable(true); + connect(slowAction, SIGNAL(triggered(bool)), this, SLOT(setSlowMode(bool))); + debugMenu->addAction(slowAction); + + if (flatmenu) flatmenu->addSeparator(); + QMenu *skinMenu = flatmenu ? flatmenu->addMenu(tr("&Skin")) : menu->addMenu(tr("&Skin")); QActionGroup *skinActions; @@ -627,6 +637,11 @@ void QmlViewer::toggleRecording() setRecording(recording); } +void QmlViewer::setSlowMode(bool enable) +{ + QUnifiedTimer::instance()->setSlowModeEnabled(enable); +} + void QmlViewer::addLibraryPath(const QString& lib) { canvas->engine()->addImportPath(lib); |