summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-15 01:00:05 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-04-15 09:36:12 +0200
commit8bc3329e2cec4638fa9af274a40dda176bbb7352 (patch)
tree87ebd27e0f6dc305c78fddb956e65bd5922a078b /tools
parent75998b22b0b216d925e93d2c0e205025c23b2522 (diff)
parent6dac2e7df7fbf0f29667bf92b4e72426db47dbe9 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta3
Conflicts: src/3rdparty/masm/assembler/LinkBuffer.h src/qmltest/doc/src/qtquicktest-index.qdoc tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7d83ad95cf489dda794dd7a0a33bad3ef3b05609
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlscene/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index c6c6ed1c4a..867267c821 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -42,6 +42,7 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlcontext.h>
+#include <QtQml/qqmlfileselector.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>
@@ -361,6 +362,7 @@ static void usage()
#endif
puts(" --textrendertype [qt|native].......Select the default render type for text-like elements.");
puts(" -I <path> ........................ Add <path> to the list of import paths");
+ puts(" -S <selector> .....................Add <selector> to the list of QQmlFileSelector selectors");
puts(" -P <path> ........................ Add <path> to the list of plugin paths");
puts(" -translation <translationfile> ... Set the language to run in");
@@ -457,6 +459,7 @@ int main(int argc, char ** argv)
Options options;
QStringList imports;
+ QStringList customSelectors;
QStringList pluginPaths;
// Parse arguments for application attributes to be applied before Q[Gui]Application creation.
@@ -529,6 +532,8 @@ int main(int argc, char ** argv)
options.verbose = true;
else if (lowerArgument == QLatin1String("-i") && i + 1 < size)
imports.append(arguments.at(++i));
+ else if (lowerArgument == QLatin1String("-s") && i + 1 < size)
+ customSelectors.append(arguments.at(++i));
else if (lowerArgument == QLatin1String("-p") && i + 1 < size)
pluginPaths.append(arguments.at(++i));
else if (lowerArgument == QLatin1String("--apptype"))
@@ -584,6 +589,8 @@ int main(int argc, char ** argv)
// TODO: as soon as the engine construction completes, the debug service is
// listening for connections. But actually we aren't ready to debug anything.
QQmlEngine engine;
+ QQmlFileSelector* selector = new QQmlFileSelector(&engine, &engine);
+ selector->setExtraSelectors(customSelectors);
QPointer<QQmlComponent> component = new QQmlComponent(&engine);
for (int i = 0; i < imports.size(); ++i)
engine.addImportPath(imports.at(i));