aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qml/main.cpp
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2025-04-23 10:58:49 +0200
committerOlivier De Cannière <olivier.decanniere@qt.io>2025-04-23 16:00:07 +0200
commit6ac4833a5172e60611987b02145de721061a2906 (patch)
tree24041f6af48fa0a73d3803c5fb414b7c198aee0b /tools/qml/main.cpp
parent9bebb7017b15da1dc9ee6401106a0d92620f4a33 (diff)
qml-tool: Treat all arguments passed after "--" as positional
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>
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r--tools/qml/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 79d75fb940..825c320c96 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -318,6 +318,9 @@ static void getAppFlags(int argc, char **argv)
{
#ifdef QT_GUI_LIB
for (int i=0; i<argc; i++) {
+ if (strcmp(argv[i], "--"))
+ return; // After "--", arguments are interpreted as positional and not as options.
+
if (!strcmp(argv[i], "--apptype") || !strcmp(argv[i], "-a") || !strcmp(argv[i], "-apptype")) {
applicationType = QmlApplicationTypeUnknown;
if (i+1 < argc) {