summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2012-02-07 12:29:45 +0000
committerQt by Nokia <qt-info@nokia.com>2012-02-14 18:20:59 +0100
commite1c2e32a8f585163f34180478ceae077397faa76 (patch)
tree20573450b7ee81215135ef77c9936694026b677e /tools
parent2d4e6ff9dd1e0e3410c4dc002c25d80fecfeafd2 (diff)
Add slow animations mode to qmlscene
Change-Id: I0f850258e2cf5363bca2fa1c8b098aa5982eb232 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlscene/main.cpp9
-rw-r--r--tools/qmlscene/qmlscene.pro2
2 files changed, 10 insertions, 1 deletions
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 <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>
+#include <private/qabstractanimation_p.h>
+
#ifdef QT_WIDGETS_LIB
#include <QtWidgets/QApplication>
#include <QtWidgets/QFileDialog>
@@ -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]