From e1c2e32a8f585163f34180478ceae077397faa76 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 7 Feb 2012 12:29:45 +0000 Subject: Add slow animations mode to qmlscene Change-Id: I0f850258e2cf5363bca2fa1c8b098aa5982eb232 Reviewed-by: Roberto Raggi --- tools/qmlscene/main.cpp | 9 +++++++++ tools/qmlscene/qmlscene.pro | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 115dace0b6..d586131845 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -55,6 +55,8 @@ #include #include +#include + #ifdef QT_WIDGETS_LIB #include #include @@ -153,6 +155,7 @@ struct Options , fullscreen(false) , clip(false) , versionDetection(true) + , slowAnimations(false) { } @@ -164,6 +167,7 @@ struct Options bool scenegraphOnGraphicsview; bool clip; bool versionDetection; + bool slowAnimations; }; #if defined(QMLSCENE_BUNDLE) @@ -342,6 +346,7 @@ static void usage() qWarning(" --fullscreen .............................. run fullscreen"); qWarning(" --no-multisample .......................... Disable multisampling (anti-aliasing)"); qWarning(" --no-version-detection .................... Do not try to detect the version of the .qml file"); + qWarning(" --slow-animations ......................... Run all animations in slow motion"); qWarning(" "); exit(1); @@ -365,6 +370,8 @@ int main(int argc, char ** argv) options.clip = true; else if (lowerArgument == QLatin1String("--no-version-detection")) options.versionDetection = false; + else if (lowerArgument == QLatin1String("--slow-animations")) + options.slowAnimations = true; else if (lowerArgument == QLatin1String("-i") && i + 1 < argc) imports.append(QString::fromLatin1(argv[++i])); else if (lowerArgument == QLatin1String("--help") @@ -384,6 +391,8 @@ int main(int argc, char ** argv) app.setOrganizationName("Nokia"); app.setOrganizationDomain("nokia.com"); + QUnifiedTimer::instance()->setSlowModeEnabled(options.slowAnimations); + if (options.file.isEmpty()) #if defined(QMLSCENE_BUNDLE) displayOptionsDialog(&options); diff --git a/tools/qmlscene/qmlscene.pro b/tools/qmlscene/qmlscene.pro index dfc91ceceb..5e4d79253e 100644 --- a/tools/qmlscene/qmlscene.pro +++ b/tools/qmlscene/qmlscene.pro @@ -2,7 +2,7 @@ TEMPLATE = app TARGET = qmlscene DESTDIR= $$QT.declarative.bins -QT += declarative quick +QT += declarative quick core-private !isEmpty(QT.widgets.name): QT += widgets target.path = $$[QT_INSTALL_BINS] -- cgit v1.2.3