aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlain Martin <ala@ableton.com>2014-12-16 14:01:29 +0100
committerAlain Martin <ala@ableton.com>2014-12-17 20:54:36 +0100
commit362e1de06d57675db552e60da84c76e42bb5aa31 (patch)
tree20b14ddc3166afd1db9397653201e89bb061809c /tools
parent9d2a5ea28adf8ab35212ca8a71b479bc50960e3d (diff)
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 <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlscene/main.cpp6
1 files changed, 6 insertions, 0 deletions
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 <path> ................................. Add <path> to the list of import paths");
+ puts(" -P <path> ................................. Add <path> to the list of plugin paths");
puts(" -translation <translationfile> ............ 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<QQmlComponent> 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