summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 9026566..08eac0a 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -94,6 +94,10 @@ void tst_QDeclarativePositioners::test_horizontal()
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 70.0);
QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 110.0);
+ QCOMPARE(row->height(), 50.0);
}
void tst_QDeclarativePositioners::test_horizontal_spacing()
@@ -115,6 +119,10 @@ void tst_QDeclarativePositioners::test_horizontal_spacing()
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 90.0);
QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 130.0);
+ QCOMPARE(row->height(), 50.0);
}
void tst_QDeclarativePositioners::test_horizontal_animated()
@@ -135,6 +143,11 @@ void tst_QDeclarativePositioners::test_horizontal_animated()
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), -100.0);
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QVERIFY(row);
+ QCOMPARE(row->width(), 100.0);
+ QCOMPARE(row->height(), 50.0);
+
//QTRY_COMPARE used instead of waiting for the expected time of animation completion
//Note that this means the duration of the animation is NOT tested
@@ -149,6 +162,11 @@ void tst_QDeclarativePositioners::test_horizontal_animated()
//Add 'two'
two->setOpacity(1.0);
QCOMPARE(two->opacity(), 1.0);
+
+ // New size should be immediate
+ QCOMPARE(row->width(), 150.0);
+ QCOMPARE(row->height(), 50.0);
+
QTest::qWait(0);//Let the animation start
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), 50.0);
@@ -176,6 +194,11 @@ void tst_QDeclarativePositioners::test_vertical()
QCOMPARE(two->y(), 50.0);
QCOMPARE(three->x(), 0.0);
QCOMPARE(three->y(), 60.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 80.0);
+ QCOMPARE(column->width(), 50.0);
}
void tst_QDeclarativePositioners::test_vertical_spacing()
@@ -197,6 +220,10 @@ void tst_QDeclarativePositioners::test_vertical_spacing()
QCOMPARE(two->y(), 60.0);
QCOMPARE(three->x(), 0.0);
QCOMPARE(three->y(), 80.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QCOMPARE(column->height(), 100.0);
+ QCOMPARE(column->width(), 50.0);
}
void tst_QDeclarativePositioners::test_vertical_animated()
@@ -216,6 +243,11 @@ void tst_QDeclarativePositioners::test_vertical_animated()
QVERIFY(three != 0);
QCOMPARE(three->y(), -100.0);
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 100.0);
+ QCOMPARE(column->width(), 50.0);
+
//QTRY_COMPARE used instead of waiting for the expected time of animation completion
//Note that this means the duration of the animation is NOT tested
@@ -230,6 +262,8 @@ void tst_QDeclarativePositioners::test_vertical_animated()
//Add 'two'
two->setOpacity(1.0);
QTRY_COMPARE(two->opacity(), 1.0);
+ QCOMPARE(column->height(), 150.0);
+ QCOMPARE(column->width(), 50.0);
QTest::qWait(0);//Let the animation start
QCOMPARE(two->y(), -100.0);
QCOMPARE(three->y(), 50.0);
@@ -264,6 +298,10 @@ void tst_QDeclarativePositioners::test_grid()
QCOMPARE(four->y(), 50.0);
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QCOMPARE(grid->width(), 120.0);
+ QCOMPARE(grid->height(), 100.0);
}
void tst_QDeclarativePositioners::test_grid_spacing()
@@ -291,6 +329,10 @@ void tst_QDeclarativePositioners::test_grid_spacing()
QCOMPARE(four->y(), 54.0);
QCOMPARE(five->x(), 54.0);
QCOMPARE(five->y(), 54.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QCOMPARE(grid->width(), 128.0);
+ QCOMPARE(grid->height(), 104.0);
}
void tst_QDeclarativePositioners::test_grid_animated()
@@ -323,6 +365,11 @@ void tst_QDeclarativePositioners::test_grid_animated()
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QVERIFY(grid);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
+
//QTRY_COMPARE used instead of waiting for the expected time of animation completion
//Note that this means the duration of the animation is NOT tested
@@ -341,6 +388,8 @@ void tst_QDeclarativePositioners::test_grid_animated()
//Add 'two'
two->setOpacity(1.0);
QCOMPARE(two->opacity(), 1.0);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
QTest::qWait(0);//Let the animation start
QCOMPARE(two->x(), -100.0);
QCOMPARE(two->y(), -100.0);
@@ -468,6 +517,11 @@ void tst_QDeclarativePositioners::test_flow()
QCOMPARE(four->y(), 70.0);
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 70.0);
+
+ QDeclarativeItem *flow = canvas->rootObject()->findChild<QDeclarativeItem*>("flow");
+ QVERIFY(flow);
+ QCOMPARE(flow->width(), 90.0);
+ QCOMPARE(flow->height(), 120.0);
}
void tst_QDeclarativePositioners::test_flow_resize()