diff options
Diffstat (limited to 'tests')
4 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/declarative/animations/data/badtype4.qml b/tests/auto/declarative/animations/data/badtype4.qml index 5db6c17..347e581 100644 --- a/tests/auto/declarative/animations/data/badtype4.qml +++ b/tests/auto/declarative/animations/data/badtype4.qml @@ -6,6 +6,7 @@ Rectangle { height: 320 Rectangle { id: MyRect + objectName: "MyRect" color: "red" width: 50; height: 50 x: 100; y: 100 diff --git a/tests/auto/declarative/animations/data/mixedtype1.qml b/tests/auto/declarative/animations/data/mixedtype1.qml index 5ecf14f..a91c6d3 100644 --- a/tests/auto/declarative/animations/data/mixedtype1.qml +++ b/tests/auto/declarative/animations/data/mixedtype1.qml @@ -6,6 +6,7 @@ Rectangle { height: 320 Rectangle { id: MyRect + objectName: "MyRect" color: "red" width: 50; height: 50 x: 100; y: 100 diff --git a/tests/auto/declarative/animations/data/mixedtype2.qml b/tests/auto/declarative/animations/data/mixedtype2.qml index 645f1d0..d12e913 100644 --- a/tests/auto/declarative/animations/data/mixedtype2.qml +++ b/tests/auto/declarative/animations/data/mixedtype2.qml @@ -6,6 +6,7 @@ Rectangle { height: 320 Rectangle { id: MyRect + objectName: "MyRect" color: "red" width: 50; height: 50 x: 100; y: 100 diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 73bed79..a6cb490 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -284,7 +284,7 @@ void tst_animations::badTypes() rect->setState("state1"); QTest::qWait(1000 + 50); - QmlGraphicsRectangle *myRect = qobject_cast<QmlGraphicsRectangle*>(rect->QGraphicsObject::children().at(3)); //### not robust + QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("MyRect"); QVERIFY(myRect); QCOMPARE(myRect->x(),qreal(200)); } @@ -324,7 +324,7 @@ void tst_animations::mixedTypes() rect->setState("state1"); QTest::qWait(500); - QmlGraphicsRectangle *myRect = qobject_cast<QmlGraphicsRectangle*>(rect->QGraphicsObject::children().at(3)); //### not robust + QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("MyRect"); QVERIFY(myRect); //rather inexact -- is there a better way? @@ -340,7 +340,7 @@ void tst_animations::mixedTypes() rect->setState("state1"); QTest::qWait(500); - QmlGraphicsRectangle *myRect = qobject_cast<QmlGraphicsRectangle*>(rect->QGraphicsObject::children().at(3)); //### not robust + QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("MyRect"); QVERIFY(myRect); //rather inexact -- is there a better way? |