diff options
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 15 | ||||
-rw-r--r-- | tools/qmlviewer/qmlviewer.h | 1 |
2 files changed, 16 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); diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index b366401..78512a9 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -104,6 +104,7 @@ public slots: void proxySettingsChanged (); void setScaleView(); void executeErrors(); + void setSlowMode(bool); protected: virtual void keyPressEvent(QKeyEvent *); |