aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-12-18 15:00:23 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-12-19 12:39:38 +0100
commit38d65db7aecee073099a5622ec3bc6e297041041 (patch)
treea5c10709522355d4d18ae8c8a97e292b6544dd5a /tests/auto/qml/qmlcppcodegen/data
parent3d12a83170fe3e9fcf61605bbb6ee717a9c983b5 (diff)
QmlCompiler: Drop the type shuffling on SetLookup
It's not necessary anymore. We can use the read register as-is. Also, explicitly name the type we are going to use to avoid integer range mismatches on coercion. Pick-to: 6.9 6.8 Task-number: QTBUG-132345 Change-Id: I98d246b03e5194235246ee8e4ebcb0a8e0094a5b Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/takenumber.h16
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/takenumber.qml16
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/takenumber.h b/tests/auto/qml/qmlcppcodegen/data/takenumber.h
index dc6845a6cc..2090a468d8 100644
--- a/tests/auto/qml/qmlcppcodegen/data/takenumber.h
+++ b/tests/auto/qml/qmlcppcodegen/data/takenumber.h
@@ -12,6 +12,11 @@ class TakeNumber : public QObject
Q_OBJECT
QML_ELEMENT
+ Q_PROPERTY(int propertyInt MEMBER propertyInt NOTIFY propertyIntChanged)
+ Q_PROPERTY(int propertyNegativeInt MEMBER propertyNegativeInt NOTIFY propertyNegativeIntChanged)
+ Q_PROPERTY(qsizetype propertyQSizeType MEMBER propertyQSizeType NOTIFY propertyQSizeTypeChanged)
+ Q_PROPERTY(qlonglong propertyQLongLong MEMBER propertyQLongLong NOTIFY propertyQLongLongChanged)
+
public:
explicit TakeNumber(QObject *parent = nullptr);
@@ -24,6 +29,17 @@ public:
int takenNegativeInt = 0;
qsizetype takenQSizeType = 0;
qlonglong takenQLongLong = 0;
+
+ int propertyInt = 0;
+ int propertyNegativeInt = 0;
+ qsizetype propertyQSizeType = 0;
+ qsizetype propertyQLongLong = 0;
+
+signals:
+ void propertyIntChanged();
+ void propertyNegativeIntChanged();
+ void propertyQSizeTypeChanged();
+ void propertyQLongLongChanged();
};
#endif // TAKENUMBER_H
diff --git a/tests/auto/qml/qmlcppcodegen/data/takenumber.qml b/tests/auto/qml/qmlcppcodegen/data/takenumber.qml
index d1511e6aff..387ae25aa5 100644
--- a/tests/auto/qml/qmlcppcodegen/data/takenumber.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/takenumber.qml
@@ -6,31 +6,47 @@ TakeNumber {
function literal0() {
foo.takeInt(0)
+ foo.propertyInt = 0;
foo.takeNegativeInt(0)
+ foo.propertyNegativeInt = 0;
foo.takeQSizeType(0)
+ foo.propertyQSizeType = 0;
foo.takeQLongLong(0)
+ foo.propertyQLongLong = 0;
}
function literal56() {
foo.takeInt(56)
+ foo.propertyInt = 56;
foo.takeNegativeInt(-56)
+ foo.propertyNegativeInt = -56;
foo.takeQSizeType(56)
+ foo.propertyQSizeType = 56;
foo.takeQLongLong(56)
+ foo.propertyQLongLong = 56;
}
function variable0() {
var a = 0
foo.takeInt(a)
+ foo.propertyInt = a;
foo.takeNegativeInt(-a)
+ foo.propertyNegativeInt = -a;
foo.takeQSizeType(a)
+ foo.propertyQSizeType = a;
foo.takeQLongLong(a)
+ foo.propertyQLongLong = a;
}
function variable484() {
var a = 484
foo.takeInt(a)
+ foo.propertyInt = a;
foo.takeNegativeInt(-a)
+ foo.propertyNegativeInt = -a;
foo.takeQSizeType(a)
+ foo.propertyQSizeType = a;
foo.takeQLongLong(a)
+ foo.propertyQLongLong = a;
}
}