diff options
Diffstat (limited to 'tests/auto/qml/qqmlpropertycache/data/duplicateIdsAndGeneralizedGroupProperties.qml')
-rw-r--r-- | tests/auto/qml/qqmlpropertycache/data/duplicateIdsAndGeneralizedGroupProperties.qml | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlpropertycache/data/duplicateIdsAndGeneralizedGroupProperties.qml b/tests/auto/qml/qqmlpropertycache/data/duplicateIdsAndGeneralizedGroupProperties.qml new file mode 100644 index 0000000000..2dd2cd8e21 --- /dev/null +++ b/tests/auto/qml/qqmlpropertycache/data/duplicateIdsAndGeneralizedGroupProperties.qml @@ -0,0 +1,64 @@ +import QtQuick 2.15 + +Item { + component First : Item { + Item { + id: a + } + + states: [ + State { + name: "test1" + + PropertyChanges { + a.enabled: false + } + } + ] + } + + component Second : Item { + QtObject { + id: a + property bool enabled: true + } + + states: [ + State { + name: "test2" + + PropertyChanges { + a.enabled: false + } + } + ] + + property Component cc: Item { + Item { id: a } + + states: [ + State { + name: "test3" + + PropertyChanges { + a.enabled: false + } + } + ] + } + } + + First { id: first } + Second { id: second } + property Item third: second.cc.createObject(); + + Component.onCompleted: { + console.log(1, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled); + first.state = "test1"; + console.log(2, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled); + second.state = "test2"; + console.log(3, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled); + third.state = "test3"; + console.log(4, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled); + } +} |