diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-22 13:40:09 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-23 12:09:42 +0100 |
commit | c8e756e560ce3f0d369df65986e5578e0e963c66 (patch) | |
tree | fcb2a9491e884103ecea358747ecb6045b2ca00a /src/qml/parser/qqmljs.g | |
parent | 6b5aa145969a30a98cba53ad8b8e5bd5e92aa154 (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.g | 3 |
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: { |