diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2011-11-14 13:40:03 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-16 03:29:39 +0100 |
commit | aa599dc4ec09645062b2671ac0482ca051a8a949 (patch) | |
tree | a42389472cf82aa11ba941fb534fb2a1988f6024 /tests/auto/declarative/qdeclarativestates/data | |
parent | 91b44d3e3a1966f2e5117942557139ac08692885 (diff) |
Remove events from the revert list.
State change "events" should be removed from the revert
list the same way property changes are.
Task-number: QTBUG-22583
Change-Id: Ia3f4d16ee8855d163a7f6118a0bc1f8492727940
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativestates/data')
-rw-r--r-- | tests/auto/declarative/qdeclarativestates/data/revertListBug.qml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativestates/data/revertListBug.qml b/tests/auto/declarative/qdeclarativestates/data/revertListBug.qml new file mode 100644 index 0000000000..fbc4bc5ecc --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/revertListBug.qml @@ -0,0 +1,47 @@ +import QtQuick 2.0 + +Rectangle { + width: 400; height: 400 + + property Item targetItem: rect1 + + function switchTargetItem() { + if (targetItem === rect1) + targetItem = rect2; + else + targetItem = rect1; + } + + states: State { + name: "reparented" + ParentChange { + target: targetItem + parent: newParent + x: 0; y: 0 + } + } + + Item { + objectName: "originalParent1" + Rectangle { + id: rect1; objectName: "rect1" + width: 50; height: 50 + color: "green" + } + } + + Item { + objectName: "originalParent2" + Rectangle { + id: rect2; objectName: "rect2" + x: 50; y: 50 + width: 50; height: 50 + color: "green" + } + } + + Item { + id: newParent; objectName: "newParent" + x: 200; y: 100 + } +} |