diff options
Diffstat (limited to 'tests/auto/declarative/qmlstates')
8 files changed, 43 insertions, 19 deletions
diff --git a/tests/auto/declarative/qmlstates/data/illegalTempState.qml b/tests/auto/declarative/qmlstates/data/illegalTempState.qml index 2702be4..0dc39ae 100644 --- a/tests/auto/declarative/qmlstates/data/illegalTempState.qml +++ b/tests/auto/declarative/qmlstates/data/illegalTempState.qml @@ -14,7 +14,7 @@ Rectangle { } ] - MouseRegion { + MouseArea { anchors.fill: parent onClicked: card.state = "placed" } diff --git a/tests/auto/declarative/qmlstates/data/legalTempState.qml b/tests/auto/declarative/qmlstates/data/legalTempState.qml index 54c97b9..9be984c 100644 --- a/tests/auto/declarative/qmlstates/data/legalTempState.qml +++ b/tests/auto/declarative/qmlstates/data/legalTempState.qml @@ -16,7 +16,7 @@ Rectangle { } ] - MouseRegion { + MouseArea { anchors.fill: parent onClicked: card.state = "placed" } diff --git a/tests/auto/declarative/qmlstates/data/parentChange.qml b/tests/auto/declarative/qmlstates/data/parentChange.qml index 087da6b..b8c7818 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange.qml @@ -12,7 +12,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange2.qml b/tests/auto/declarative/qmlstates/data/parentChange2.qml index f0b00f5..8b23591 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange2.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange2.qml @@ -15,7 +15,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange3.qml b/tests/auto/declarative/qmlstates/data/parentChange3.qml index 2aa507c..ddf9268 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange3.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange3.qml @@ -16,7 +16,7 @@ Rectangle { color: "red" } } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange4.qml b/tests/auto/declarative/qmlstates/data/parentChange4.qml index d00274b..34d667a 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange4.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange4.qml @@ -9,7 +9,7 @@ Rectangle { width: 100; height: 100 color: "red" } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/data/parentChange5.qml b/tests/auto/declarative/qmlstates/data/parentChange5.qml index f75e2a3..56bdd89 100644 --- a/tests/auto/declarative/qmlstates/data/parentChange5.qml +++ b/tests/auto/declarative/qmlstates/data/parentChange5.qml @@ -9,7 +9,7 @@ Rectangle { width: 100; height: 100 color: "red" } - MouseRegion { + MouseArea { id: clickable anchors.fill: parent } diff --git a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp index 81145a8..b910c85 100644 --- a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp +++ b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp @@ -407,8 +407,12 @@ void tst_qmlstates::parentChange() QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); QVERIFY(innerRect != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlParentChange *pChange = qobject_cast<QmlParentChange*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlParentChange *pChange = qobject_cast<QmlParentChange*>(state->operationAt(0)); QVERIFY(pChange != 0); QmlGraphicsItem *nParent = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("NewParent")); QVERIFY(nParent != 0); @@ -510,8 +514,12 @@ void tst_qmlstates::anchorChanges() QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); QVERIFY(innerRect != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("right"); @@ -565,8 +573,12 @@ void tst_qmlstates::anchorChanges3() QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("reanchored"); @@ -611,8 +623,12 @@ void tst_qmlstates::anchorChanges4() QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("reanchored"); @@ -642,8 +658,12 @@ void tst_qmlstates::anchorChanges5() QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); - qmlExecuteDeferred(rect->states()->at(0)); - QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rect->setState("reanchored"); @@ -700,7 +720,11 @@ void tst_qmlstates::explicitChanges() QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - qmlExecuteDeferred(rect->states()->at(0)); + QmlListReference list(rect, "states"); + QmlState *state = qobject_cast<QmlState*>(list.at(0)); + QVERIFY(state != 0); + + qmlExecuteDeferred(state); QmlPropertyChanges *changes = qobject_cast<QmlPropertyChanges*>(rect->findChild<QmlPropertyChanges*>("changes")); QVERIFY(changes != 0); QVERIFY(changes->isExplicit()); @@ -802,7 +826,7 @@ void tst_qmlstates::deletingChange() QmlState *state = rect->findChild<QmlState*>(); QVERIFY(state != 0); qmlExecuteDeferred(state); - QCOMPARE(state->changes()->count(), 1); + QCOMPARE(state->operationCount(), 1); rect->setState("blue"); QCOMPARE(rect->color(),QColor("red")); |