aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljs.g
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-02-22 13:40:09 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-02-23 12:09:42 +0100
commitc8e756e560ce3f0d369df65986e5578e0e963c66 (patch)
treefcb2a9491e884103ecea358747ecb6045b2ca00a /src/qml/parser/qqmljs.g
parent6b5aa145969a30a98cba53ad8b8e5bd5e92aa154 (diff)
QML: Take care of QVariant when converting function arguments
We cannot convert to QVariant using QMetaType::convert(). But we can just construct a QVariant with the desired type and data. This will become an issue once we automatically convert argument types to match the desired type inside the function. As a side effect, also allow declaring "var" arguments to functions. Change-Id: Idc14021d8d85d3d09ee7b7f286de91b56ea02bfd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljs.g')
-rw-r--r--src/qml/parser/qqmljs.g3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index 306f3d40f9..1ffdddc1e1 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -1680,6 +1680,9 @@ Type: UiQualifiedId;
} break;
./
+Type: T_VAR;
+/. case $rule_number: Q_FALLTHROUGH(); ./
+
Type: T_VOID;
/.
case $rule_number: {