summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/states/data/parentChange.qml1
-rw-r--r--tests/auto/declarative/states/tst_states.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/declarative/states/data/parentChange.qml b/tests/auto/declarative/states/data/parentChange.qml
index 94fbd69..29596a8 100644
--- a/tests/auto/declarative/states/data/parentChange.qml
+++ b/tests/auto/declarative/states/data/parentChange.qml
@@ -21,6 +21,7 @@ Rectangle {
x: -100; y: -50
Item {
id: newParent
+ objectName: "NewParent"
x: 248; y: 360
}
}
diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp
index 671ca33..92d278a 100644
--- a/tests/auto/declarative/states/tst_states.cpp
+++ b/tests/auto/declarative/states/tst_states.cpp
@@ -391,6 +391,13 @@ void tst_states::parentChange()
QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"));
QVERIFY(innerRect != 0);
+ QmlParentChange *pChange = qobject_cast<QmlParentChange*>(rect->states()->at(0)->changes()->at(0));
+ QVERIFY(pChange != 0);
+ QmlGraphicsItem *nParent = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("NewParent"));
+ QVERIFY(nParent != 0);
+
+ QCOMPARE(pChange->parent(), nParent);
+
rect->setState("reparented");
QCOMPARE(innerRect->rotation(), qreal(0));
QCOMPARE(innerRect->scale(), qreal(1));