From 362e1de06d57675db552e60da84c76e42bb5aa31 Mon Sep 17 00:00:00 2001 From: Alain Martin Date: Tue, 16 Dec 2014 14:01:29 +0100 Subject: Add -P argument to qmlscene to specify plugins search path Allow users to specify locations of compiled QML plugins. Change-Id: I0ad764282a7891013ce0cfa008a1cf8164cb083b Reviewed-by: Laszlo Agocs --- tools/qmlscene/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools') diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 73e8a9ac6d..522a810d9e 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -351,6 +351,7 @@ static void usage() puts(" --quit .................................... Quit immediately after starting"); puts(" --disable-context-sharing ................. Disable the use of a shared GL context for QtQuick Windows"); puts(" -I ................................. Add to the list of import paths"); + puts(" -P ................................. Add to the list of plugin paths"); puts(" -translation ............ Set the language to run in"); puts(" "); @@ -362,6 +363,7 @@ int main(int argc, char ** argv) Options options; QStringList imports; + QStringList pluginPaths; for (int i = 1; i < argc; ++i) { if (*argv[i] != '-' && QFileInfo(QFile::decodeName(argv[i])).exists()) { options.file = QUrl::fromLocalFile(argv[i]); @@ -391,6 +393,8 @@ int main(int argc, char ** argv) options.contextSharing = false; else if (lowerArgument == QLatin1String("-i") && i + 1 < argc) imports.append(QString::fromLatin1(argv[++i])); + else if (lowerArgument == QLatin1String("-p") && i + 1 < argc) + pluginPaths.append(QString::fromLatin1(argv[++i])); else if (lowerArgument == QLatin1String("--help") || lowerArgument == QLatin1String("-help") || lowerArgument == QLatin1String("--h") @@ -454,6 +458,8 @@ int main(int argc, char ** argv) QPointer component = new QQmlComponent(&engine); for (int i = 0; i < imports.size(); ++i) engine.addImportPath(imports.at(i)); + for (int i = 0; i < pluginPaths.size(); ++i) + engine.addPluginPath(pluginPaths.at(i)); if (options.file.isLocalFile()) { QFileInfo fi(options.file.toLocalFile()); #ifndef QT_NO_TRANSLATION -- cgit v1.2.3