From 9a5dd525723363dc4230595c85f4406f27d5c0f2 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 17 Nov 2009 15:37:51 +1000 Subject: AnchorChanges test --- tests/auto/declarative/states/data/anchorChanges.qml | 1 + tests/auto/declarative/states/tst_states.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/auto/declarative/states/data/anchorChanges.qml b/tests/auto/declarative/states/data/anchorChanges.qml index bb17840..4afdee3 100644 --- a/tests/auto/declarative/states/data/anchorChanges.qml +++ b/tests/auto/declarative/states/data/anchorChanges.qml @@ -14,6 +14,7 @@ Rectangle { states: State { name: "right" AnchorChanges { + id: AncCh target: myRect; reset: "left" right: container.right diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index fe90191..0e0a72a 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -479,8 +479,12 @@ void tst_states::anchorChanges() QmlGraphicsRectangle *innerRect = qobject_cast(rect->findChild("MyRect")); QVERIFY(innerRect != 0); + QmlAnchorChanges *aChanges = qobject_cast(rect->states()->at(0)->changes()->at(0)); + QVERIFY(aChanges != 0); + rect->setState("right"); QCOMPARE(innerRect->x(), qreal(150)); + QCOMPARE(aChanges->reset(), QString("left")); rect->setState(""); QCOMPARE(innerRect->x(), qreal(5)); -- cgit v0.12