aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-11-20 09:55:31 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-11-21 15:25:56 +0100
commit7ed5f038fcbe95111a99c90602fbf09368892a13 (patch)
tree8cb45de872abce5d43ca60ba62abca253b7bb205 /tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml
parent828af69f8cfc2ef66dd80478de0fc5f94053ec2f (diff)
QmlCompiler: Add AsVariant initializations for SetLookup
With SetLookup there is always the possibility of causing a reset by passing undefined. That's why we need to wrap the argument into QVariant most of the time. SetValueLookup didn't take this into account, which resulted in invalid code. The test also reveals that a number of cases were generating different errors depending on whether the code was run in interpreted or compiled mode. Align those. Pick-to: 6.8 Task-number: QTBUG-127174 Change-Id: I88f45977dcd0eeba8aaf580663d4b85b8bb26f72 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml b/tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml
index 29e66539f7..5ed647830b 100644
--- a/tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/qmlUsing.qml
@@ -15,6 +15,13 @@ T.UsingUserObject {
property int myA2: self.a
property int myB2: self.getB()
+ property var valU: val.u
+ property var myU: u
+ property var myU2: self.u
+
+ property var huge: 4294967295
+ property var impossible: "impossible"
+
function twiddle() {
val.a = 55
// val.setB(56)
@@ -22,5 +29,40 @@ T.UsingUserObject {
setB(58)
self.a = 59
self.setB(60)
+
+ val.u = 61
+ u = 62
+ self.u = 63
+ }
+
+ function burn() {
+ val.u = huge
+ u = huge
+ u = 64
+ self.u = huge
+ }
+
+ function impossibleValA() {
+ val.a = impossible
+ }
+
+ function impossibleA() {
+ a = impossible
+ }
+
+ function impossibleSelfA() {
+ self.a = impossible
+ }
+
+ function impossibleValU() {
+ val.u = impossible
+ }
+
+ function impossibleU() {
+ u = impossible
+ }
+
+ function impossibleSelfU() {
+ self.u = impossible
}
}