diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-03-21 12:49:15 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-21 08:04:33 +0100 |
commit | 94052647d25f3da3903574a66051466d09eecf5e (patch) | |
tree | 51d269767d4419c10f6d6cf3f8a91eb0a9473659 /tools/qmlscene | |
parent | 8dbfddff68f98c8854c3ca663db727d2e8c65377 (diff) |
Allow qmlscene to quit immediately after starting
Useful for running tests that have no interactive element, where all
computation is performed in the initialization phase of processing
the QML source.
Change-Id: Id3f87fc504a30eb4e351804a98fe265db8fe93c9
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tools/qmlscene')
-rw-r--r-- | tools/qmlscene/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 327dfc6889..32c9be7f46 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -156,6 +156,7 @@ struct Options , clip(false) , versionDetection(true) , slowAnimations(false) + , quitImmediately(false) { } @@ -168,6 +169,7 @@ struct Options bool clip; bool versionDetection; bool slowAnimations; + bool quitImmediately; }; #if defined(QMLSCENE_BUNDLE) @@ -347,6 +349,7 @@ static void usage() 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(" --quit .................................... Quit immediately after starting"); qWarning(" "); exit(1); @@ -372,6 +375,8 @@ int main(int argc, char ** argv) options.versionDetection = false; else if (lowerArgument == QLatin1String("--slow-animations")) options.slowAnimations = true; + else if (lowerArgument == QLatin1String("--quit")) + options.quitImmediately = true; else if (lowerArgument == QLatin1String("-i") && i + 1 < argc) imports.append(QString::fromLatin1(argv[++i])); else if (lowerArgument == QLatin1String("--help") @@ -428,6 +433,10 @@ int main(int argc, char ** argv) else window->show(); + if (options.quitImmediately) { + QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); + } + exitCode = app.exec(); delete window; |