aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qml/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adjust to QUnifiedTimer slow mode changesMitch Curtis2025-06-271-1/+1
| | | | | | | | | a318e331f1387eb3c9d13be96c28619453a35571 in qtbase. Task-number: QTBUG-137919 Change-Id: I98e3871053bbb04b83aa114844f07293501d95d6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qml-tool: Treat all arguments passed after "--" as positionalOlivier De Cannière2025-04-231-0/+3
| | | | | | | | | | | The argument "-a" passed after "--" was being interpreted as the -a option of the qml tool itself instead of being passed along to the qml program as a positional argument. Fixes: QTBUG-136120 Pick-to: 6.9 6.8 6.5 Change-Id: I602aea84e4766abeb47adce0f739f12315a70b24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qml tool: Explictily register typesFabian Kosmale2025-02-121-0/+5
| | | | | | | | | | | | We are sporadically seeing weird failures on macOs that the types from the module are not available. This could not be reproduced reliably, but we suspect that the linker might discard the (static ctor invoking the) registration function. Avoid this by calling it explictily. Change-Id: Ic405dd5f226af3580efe7dd5d8202a6a263a367e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Mention d3d12 in qml tool help textLaszlo Agocs2024-03-141-1/+1
| | | | | | | | | | | | It works since 6.6 regardless, but the help text had no mentioning of it at all. Also use the nicer "opengl" instead of "gl" (both are accepted by QSG_RHI_BACKEND anyway) Pick-to: 6.7 6.6 Change-Id: Ibf6de9411d8641d244b8750fd7a015781a9297b1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix some compile errors when compiling with -no-gui -no-qml-debugUlf Hermann2024-01-171-0/+2
| | | | | Change-Id: I33254477ad4535c898d1091b1275cc4d9a3de5d4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qml tool: Use QCommandLineParser::process() rather than parse()Shawn Rutledge2023-05-161-10/+3
| | | | | | | | | | | | This handles the --version, --help and --help-all options. Apparently there's no other way to handle --help-all, because addHelpOption() adds two options but only returns one of them. Amends bb6602bca2b20d98f24320b10c7a039e605c9a05 Fixes: QTBUG-100678 Pick-to: 6.2 6.5 5.15 Change-Id: Iddd1ba2dae975d7256935d8d357e2f3ac6c013d6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qml: Straighten out configuration QML moduleUlf Hermann2023-05-081-4/+12
| | | | | | | | | | | | Use qt_add_qml_module correctly, apply a standard resource path, and move the files into the same directory as the module. Use upper case file names for the (re-usable) container definitions and lower case file names for the configuration entry points. This way we only need one directory and therefore only one QML module. Change-Id: Ic45dd0e8866f8f62bbaa639b6f138e9a75e05863 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qml: Construct QQmlApplicationEngine only when we need itUlf Hermann2023-04-271-1/+3
| | | | | | | | | | Otherwise we leak a lot of memory if any of the exit() calls is triggered. Change-Id: I338abe2ef63217e6b80ffc2f8fe65d9cac03d994 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qml tool: Fix incorrect mapping of --transparent to MSAALaszlo Agocs2023-03-171-1/+1
| | | | | Change-Id: Ief9f12c1b3dfab928b110278c1d49abb1028efe0 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* bin/qml: Fix broken handling of --translation commandline argumentJan Arve Sæther2023-02-081-2/+1
| | | | | | | | | The QTranslator was destructed right after it was loaded because it was inside a scope Pick-to: 6.5 Change-Id: I8c9d1604652f18f7d15aa7a0045f580cd8a25063 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Bring QSurfaceFormat configurability to qmlscene's level in the qml toolLaszlo Agocs2023-02-071-12/+39
| | | | | | | | | | | | | | | | | | | Restore the --transparent and --multisample options. Also make the default QSurfaceFormat setting universal (no need to tie it to the option of forcing a core profile context), and prevent the warning that is printed when the default surfaceformat is changed after the application is already created with AA_ShareOpenGLContexts set. This involves having to handle the relevant arguments manually early on, not through QCommandLineParser. All this matches the qmlscene behavior. NB qmlscene requests 16 samples with --multisample which is completely pointless in practice. Use the common 4 now. Change-Id: I671e5f22846a715675ea936bb7cf2a31a849dc28 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* qml tool: Disable shader caching by defaultPaul Olav Tvete2023-02-071-0/+8
| | | | | | | | | | When shaders are generated dynamically, such as with QtQuick3D, cached shaders may get out of date if the QML file is changed. Change-Id: I2c5484765e30da5c13fd175a9fcbad2473d55e62 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* qml: Fix object countingUlf Hermann2023-01-231-17/+3
| | | | | | | | | | | | We're not actually interested in whether an object is a window, and we don't really care how many objects are created. The only thing we need to know is whether at least one object is alive after all files have been processed. Pick-to: 6.5 Fixes: QTBUG-110112 Change-Id: I8d79359f3fb7ec5a54545dc5858cf310b0f52935 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-2/+2
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-28/+3
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qml: Don't mangle the settings URLUlf Hermann2022-03-021-5/+6
| | | | | | | | If you do QUrl::fromLocalFile() on a file name starting with ":" you get a rather curious URL. Change-Id: I07d35e792b87a66fffc9c992462d92a4c0c8040d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qml: Deprecate the --dummy-data optionShawn Rutledge2021-09-241-5/+15
| | | | | | | | | | [ChangeLog][QtQml][qml] The QML Runtime tool's --dummy-data option is now deprecated, because context properties are deprecated. This option will be removed in a future version of Qt. Task-number: QTBUG-96800 Change-Id: Id6ef8a384f6239ddeebd6c4f84854bbeaf630279 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Teach the qml runtime to load config files by basenameShawn Rutledge2021-09-221-8/+33
| | | | | | | | | | | | | | | | | | | Also, --list-conf will now list the conf files that it finds; and --verbose will show more information about the path(s) to them. [ChangeLog][QtQml][qml] The QML Runtime tool's -c / --config option now can find a directory containing a file called configuration.qml under QStandardPaths::AppConfigLocation, in addition to being able to give the full path to the configuration file, as before. I.e. on Linux you could write a custom configuration into ~/.config/QtProject/Qml Runtime/myconfig/configuration.qml and then use it via qml -c myconfig somefile.qml. The --list-conf option will list the configurations that can be found in this way. Task-number: QTBUG-26366 Fixes: QTBUG-96740 Change-Id: I72798b22255b71b9d4184a67f86b249766b64233 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qml: Avoid memory leaks when no objects are loadedUlf Hermann2021-08-101-1/+2
| | | | | | | | | | Instead of std::exit() use the early return mechanism we already have so that any existing objects are gracefully destroyed. Change-Id: Icb197879cc33ab22f07fc1486da44f9ff5b177bc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* qml: Don't leak the created objectsUlf Hermann2021-05-211-0/+1
| | | | | | | | | | Rather, parent them to the watcher. The watcher lives in the main() function's scope. Change-Id: I2ac1d14d80d4100756a3ad94b6502d46fda30074 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qml: Enable context sharing by defaultMaximilian Goldstein2021-03-221-0/+10
| | | | | | | | | | | The qml utility now uses context sharing by default, as previously done by qmlscene. It can also be disabled in the same way, by specifying --disable-context-sharing. This is needed for compatibility with QtWebEngine among other things. Fixes: QTBUG-85107 Change-Id: I6155d32dfc55b385d33e1c805dae601b9710427e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tools/qml: Implement --core-profile optionMaximilian Goldstein2021-03-191-1/+4
| | | | | | | | | Already possible to do the same using environment variables but this ensures greater compatibility with qmlscene and better ease of use. Change-Id: I214aec41aad4369f54bca887e91ccb879153c8be Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Uniformly support shebangFawzi Mohamed2021-02-151-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | The "qml" tool was the only way of loading QML files that would respect a shebang line. This is problematic as this way you cannot load such files programatically using QQmlComponent, limiting their re-use. Common tools like Qt Creator, but also qmllint, qmlformat, qmlcachegen, etc would not recognize files with shebangs. By moving she-bang support directly in the lexer all tools implicitly support it. Note that we could just as easily support '#' as extra comment character along with //, but here we narrowly add support for in the first line only, as node does (this means that javascript files using she-bang accepted by node, are now accepted also by qml). The only tool needing some adjustments is qmlformat, that has to emit the she-bang again as she-bang and as first line. Add tests for qmlformat, and sprinkle some she-bangs in the other tests just to be sure it doesn't affect anything. Change-Id: I1f6d881c7438bdb23163b5dbe829d59a35d11132 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-181-4/+3
| | | | | | | So we can remove it. Change-Id: I037373f85c696ce04c55920b41377cc9843b0da3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace deprecated DataLocation with AppDataLocationShawn Rutledge2020-10-251-1/+1
| | | | | | Task-number: QTBUG-87037 Change-Id: I1cb6cd15fbb5fe08a0280ed83d01fc1b49249524 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Remove use of deprecated High-DPI application attributesTor Arne Vestbø2020-09-021-10/+0
| | | | | Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add ; to Q_UNUSED and UNUSED_PARAMLars Schmertmann2020-06-261-4/+4
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Clean up QT_CONFIG(opengl)Paul Olav Tvete2020-06-171-5/+4
| | | | | | | | | | Accelerated graphics is now possible without OpenGL support. With this change, a Qt build with -no-opengl can still run Qt Quick with a Vulkan, Metal, or Direct3D backend. Fixes: QTBUG-84027 Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove openGLContextCreated signalLaszlo Agocs2020-06-101-29/+1
| | | | | | | | | | | | | | | | No reason to have this in the API in 6.0, and it's already not emitted at all in dev (because the direct OpenGL code path is now gone from the render loops) Some simple GL string printing has been removed from qml/qmlscene. This opt-in feature has not been useful in practice anyway since QSG_INFO=1 prints the same things. [ChangeLog][Qt Quick][QQuickWindow] The openGLContextCreated signal has been removed from QQuickWindow. Change-Id: Ifb647bbd1e828ebad2b775e8ce5c38723a0cda13 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Clean up QQmlFileSelectorUlf Hermann2020-03-191-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The global static map of file selectors is not thread safe. If you add a file selector to engine A running in thread 1, you cannot at the same time retrieve the file selector of engine B running in thread 2. Alas, we only need the static map to discern file selectors from other URL interceptors, and we only need to do this on QQmlFileSelector::get(), which we don't use. Unfortunately it is public API, though. Deprecate QQmlFileSelector::get() and add a different hack to discern the interceptors for the case that it's still called. Also remove the duplicate setExtraSelectors() method. For this to work, we also add a method to QQmlApplicationEngine that allows us to pass extra file selectors and delay the initialization of QQmlApplicationEngine's QQmlFileSelector until the first file is loaded. [ChangeLog][QML] QQmlFileSelector::get() is deprecated. You can use the new method QQmlAplicationEngine::setExtraFileSelectors() to pass extra selectors to QQmlApplicationEngine's internal QQmlFileSelector. Manually created QQmlFileSelectors should be configured immediately after creation, before they are used by the QQmlEngine. Change-Id: Ia61a93777dc910b441a03ffb42d35a2a224c0e26 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-211-1/+0
|\ | | | | | | | | | | | | Conflicts: tests/auto/quick/qquickmousearea/BLACKLIST Change-Id: I3de2c6377d57f5f9204d2cfc688d50a7a0b4150c
| * Tools: Convert to static type registrationsUlf Hermann2020-02-201-1/+0
| | | | | | | | | | | | | | | | qml and qmltime were still using qmlRegisterType() for some internals. Let's get rid of those. Change-Id: I68c0e7213f3b5b28670364c4db1cdec41d299b7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-171-0/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/qtqml/plugin.cpp src/qml/qml/qqml.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypeloader.cpp src/qml/types/qqmlbind.cpp src/quick/items/qquickitemsmodule.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
| * Add QML_CORE_PROFILE support to QML toolThomas Hartmann2020-02-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | If QML_CORE_PROFILE is defined we use the CoreProfile surface format. This is required for QtQuick3D. For consistency we also introduce QSG_CORE_PROFILE. Adding QSG_CORE_PROFILE also to qmlscene. Change-Id: I4feee91740162cf36fa2668695b74f5a1279bb89 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Add support for file selectors to qml toolThomas Hartmann2020-02-041-0/+13
| | | | | | | | | | | | | | | | | | | | This allows defining file selectors using a command-line option. [ChangeLog][QtQml][qml] The QML Runtime tool --selector option now allows defining a custom QQmlFileSelector. Change-Id: I1be5efd273b2f387df72b1d5057f7281e5c0c156 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-211-25/+26
|\| | | | | | | Change-Id: Ic2cea85917751b89c34768fd80d8b11f5706dd62
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-201-25/+26
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitemview.cpp Change-Id: Ib9faebdbef5eebb80f4e6aeb5b15b5df7494b157
| | * qml: Fix options that need to be set before QApplication instantiationFriedemann Kleint2020-01-151-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the Open GL and scaling options setting QCoreApplication attributes into the helper getAppFlags() which already handles the application type. Change getAppFlags() to not modify argv which is not necessary since the parser will accept the options. Change-Id: Ib2f94f832e6551a938ff0e9bfe27649850d38d1e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Fix -no-gui build on macOSTasuku Suzuki2019-12-271-1/+1
|/ / | | | | | | | | Change-Id: Ifc520d58fc7294bad5c90e13ac72bb603f6fd33c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-041-6/+8
|\| | | | | | | | | | | | | | | Conflicts: src/imports/qtquick2/plugins.qmltypes src/quick/items/qquickitemsmodule.cpp Change-Id: I841c65c9c131354788b4f3fcfe3d7ed27be316d5
| * qml: Make sure the qml tool deletes its applicationUlf Hermann2019-10-021-6/+8
| | | | | | | | | | | | | | | | | | Otherwise the shutdown mechanism for debug services doesn't work. Fixes: QTBUG-78828 Change-Id: I4ede5861a300d5b5007036d71ed84409ec4d450f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Specify parameters of type registration in class declarationsUlf Hermann2019-09-261-2/+1
|/ | | | | | | | | | | | | | | | | | | | | Using this technique we can automatically register all necessary revisions and minor versions of a type, using the metaobject system. This greatly reduces the potential for mistakes and resulting incompatibilities between versions of imports. We assume that for each type we need to register all revisions of its super types and its attached type, and that the revisions match. That is, if you import version X of type A, you will also get version X of its attached type and of any super types. As we previously didn't take these dependencies into account when manually registering the types, a number of extra revisions are now registered for some types. Potentially, we can now generate the qmltypes files at compile time, using moc. Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add the graphics api independent scenegraph portLaszlo Agocs2019-07-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qml runtime tool: support alternate conf; add resizeToItem confShawn Rutledge2019-04-251-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | The qmlscene --resize-to-root feature has always been missing from the qml runtime tool; however it was already possible to add it by writing a custom configuration file. Now we support loading different configurations from resources as well as from the filesystem, and the first new configuration being added here is resizeToItem.qml which provides behavior equivalent to qmlscene --resize-to-root. When the argument given to --config ends with .qml, by convention it's to be loaded from the filesystem; whereas configurations from resources are specified without the .qml extension (to make the command line shorter). [ChangeLog][QtQml][qml] The QML Runtime tool now has default behavior matching qmlscene when the root QML object is an Item: it will be wrapped in a Window which will resize the Item when the Window is resized. But you can alternatively use the --config resizeToItem option, resulting in the same behavior as qmlscene --resizeToRoot: resizing the root Item programmatically causes the wrapping Window to be resized. Behavior can still be customized in other ways using the --config option with an external QML configuration file. Task-number: QTBUG-53557 Change-Id: Icdcbbd12258105c33b64634049d735e022dfbd06 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qml runtime tool: --quiet disables categorized logging tooShawn Rutledge2019-04-251-2/+5
| | | | | | | | | | | [ChangeLog][QtQml][qml] The QML Runtime tool --quiet option now disables categorized logging in addition to qDebug, qInfo, qWarning and qFatal, except for some early QPA-level categorized logging that occurs during application construction. You can still override specific categories by setting QT_LOGGING_CONF or QT_LOGGING_RULES. Change-Id: Icf986a7fa9980d07beed308df8f69fcc4da9d771 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qml runtime tool: group globals and declare static; improve paddingShawn Rutledge2019-04-251-43/+29
| | | | | | | This fixes a few code model warnings. Change-Id: I0739e19ad5601caa4177f0fd843b1a8d38c936a6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use QCommandLineParser in the qml runtime toolShawn Rutledge2019-04-241-114/+122
| | | | | | | | | | | | | Some advantages: - support double-hyphen options as well as the existing single-hyphen options - support translation of the usage text [ChangeLog][QtQml][qml] The QML Runtime tool now accepts command-line arguments in double-dash GNU style as well as the old single-dash style. Task-number: QTBUG-53557 Change-Id: I9929c63841272894640abe254efaea9773eee633 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-191-1/+6
|\ | | | | | | Change-Id: I9ef4be23bfe35aa48d4c65d4159e72c527943845
| * Update the QML Runtime iconShawn Rutledge2019-04-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new one has been drawn; use it on all platforms, not just on macOS. It is now also used as the default window icon, to be more identifiable when minimized, etc. Of course it can be overridden by plugins that can be loaded from qml. [ChangeLog][QtQml][qml] The QML Runtime tool now has an updated application icon and a default window icon. QtQuick applications can still use QWindow::setIcon() to override the window icon. Task-number: QTBUG-70826 Task-number: QTBUG-74662 Change-Id: I8671d0c99f7f4283dbe2dc4c605abb560f7bf1a1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>