aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-03-01 08:44:28 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-01 12:37:40 +0000
commitae7923fb380834dbe54a5eaa6f20ffaff10fd40c (patch)
tree4289d9f7b041f31a929774c17b0d57b56b9304a1 /tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml
parent9e14afa9a034e6cf9e34e1e81d6b0cc7509d7568 (diff)
QmlCompiler: On MoveReg, check if we need to move at all
As we don't store void, null and empty lists, moving those is a noop. Don't generate invalid code for that. Change-Id: Ica6714acd0ce8a5ddca44d9a397e776eb3df4247 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 074b66e0073b55d32060ffd542a02c811ad763a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml')
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml b/tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml
new file mode 100644
index 0000000000..f1e78babba
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/moveRegVoid.qml
@@ -0,0 +1,20 @@
+import QtQuick
+
+Rectangle {
+ id: root
+ property bool translucency: false
+
+ gradient: Gradient {
+ id: grad
+ }
+
+ onTranslucencyChanged: {
+ if (translucency) {
+ root.color = "transparent";
+ root.gradient = null;
+ } else {
+ root.color = "white";
+ root.gradient = grad;
+ }
+ }
+}