diff options
Diffstat (limited to 'tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp')
-rw-r--r-- | tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp b/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp index a9bdf4249b..3b2a504ff4 100644 --- a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp +++ b/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp @@ -68,6 +68,7 @@ private slots: void test_horizontal_spacing_rightToLeft(); void test_horizontal_animated(); void test_horizontal_animated_rightToLeft(); + void test_horizontal_animated_disabled(); void test_vertical(); void test_vertical_spacing(); void test_vertical_animated(); @@ -328,6 +329,46 @@ void tst_qsgpositioners::test_horizontal_animated_rightToLeft() delete canvas; } +void tst_qsgpositioners::test_horizontal_animated_disabled() +{ + QSGView *canvas = createView(SRCDIR "/data/horizontal-animated-disabled.qml"); + + QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QVERIFY(one != 0); + + QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QVERIFY(two != 0); + + QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QVERIFY(three != 0); + + QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QVERIFY(row); + + qApp->processEvents(); + + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(two->isVisible(), false); + QCOMPARE(two->x(), -100.0);//Not 'in' yet + QCOMPARE(two->y(), 0.0); + QCOMPARE(three->x(), 50.0); + QCOMPARE(three->y(), 0.0); + + //Add 'two' + two->setVisible(true); + QCOMPARE(two->isVisible(), true); + qApp->processEvents(); + QCOMPARE(row->width(), 150.0); + QCOMPARE(row->height(), 50.0); + + qApp->processEvents(); + QCOMPARE(two->x(), 50.0); + QCOMPARE(three->x(), 100.0); + + delete canvas; +} + void tst_qsgpositioners::test_vertical() { QSGView *canvas = createView(SRCDIR "/data/vertical.qml"); |