diff options
author | Caroline Chao <caroline.chao@digia.com> | 2013-09-18 11:18:31 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 18:48:24 +0200 |
commit | b3f45a1172adcfac58454efe10ea8d0725d78b22 (patch) | |
tree | cf7bf037f30446a980323765c80825b42ea58910 /tools | |
parent | 13d56d51ad5b263bf37bcf380e22e53eadbc4b57 (diff) |
qmlplugindump: Add --defaultplatform argument
QT_QPA_PLATFORM is set to minimal by default unless
--defaultplatform is set when running the qmlplugindump tool.
This is for example useful for the QtQuick.Dialogs module.
Change-Id: I1194526ee0641d11802c4db20bd3043aebd1e261
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlplugindump/main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index a6f55621fa..a28fd0096b 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -627,7 +627,7 @@ void sigSegvHandler(int) { void printUsage(const QString &appName) { qWarning() << qPrintable(QString( - "Usage: %1 [-v] [-noinstantiate] [-[non]relocatable] module.uri version [module/import/path]\n" + "Usage: %1 [-v] [-noinstantiate] [-defaultplatform] [-[non]relocatable] module.uri version [module/import/path]\n" " %1 [-v] [-noinstantiate] -path path/to/qmldir/directory [version]\n" " %1 [-v] -builtins\n" "Example: %1 Qt.labs.folderlistmodel 2.0 /home/user/dev/qt-install/imports").arg( @@ -654,7 +654,17 @@ int main(int argc, char *argv[]) #endif // don't require a window manager even though we're a QGuiApplication - qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal")); + bool requireWindowManager = false; + for (int index = 1; index < argc; ++index) { + if (QString::fromLocal8Bit(argv[index]) == "--defaultplatform" + || QString::fromLocal8Bit(argv[index]) == "-defaultplatform") { + requireWindowManager = true; + break; + } + } + + if (!requireWindowManager) + qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal")); QGuiApplication app(argc, argv); const QStringList args = app.arguments(); @@ -696,6 +706,9 @@ int main(int argc, char *argv[]) action = Builtins; } else if (arg == QLatin1String("-v")) { verbose = true; + } else if (arg == QLatin1String("--defaultplatform") + || arg == QLatin1String("-defaultplatform")) { + continue; } else { qWarning() << "Invalid argument: " << arg; return EXIT_INVALIDARGUMENTS; |