diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-04-15 03:34:07 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-04-15 03:34:07 (GMT) |
commit | 451f1f33fa65ba213b1585592225c358f124146a (patch) | |
tree | 6f24ff4af2bcd42bbc6f4f10254e7a4182484127 /tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp | |
parent | c0eb81664f2bae225dcaca897c23564d6f97a3d1 (diff) | |
download | Qt-451f1f33fa65ba213b1585592225c358f124146a.zip Qt-451f1f33fa65ba213b1585592225c358f124146a.tar.gz Qt-451f1f33fa65ba213b1585592225c358f124146a.tar.bz2 |
Add flow property to Grid, adding TopToBottom mode.
Task-number: QTBUG-9183
Diffstat (limited to 'tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index 8692596..b4ac0e1 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -61,6 +61,7 @@ private slots: void test_vertical_spacing(); void test_vertical_animated(); void test_grid(); + void test_grid_topToBottom(); void test_grid_spacing(); void test_grid_animated(); void test_grid_zero_columns(); @@ -305,6 +306,37 @@ void tst_QDeclarativePositioners::test_grid() QCOMPARE(grid->height(), 100.0); } +void tst_QDeclarativePositioners::test_grid_topToBottom() +{ + QDeclarativeView *canvas = createView(SRCDIR "/data/grid-toptobottom.qml"); + + QDeclarativeRectangle *one = canvas->rootObject()->findChild<QDeclarativeRectangle*>("one"); + QVERIFY(one != 0); + QDeclarativeRectangle *two = canvas->rootObject()->findChild<QDeclarativeRectangle*>("two"); + QVERIFY(two != 0); + QDeclarativeRectangle *three = canvas->rootObject()->findChild<QDeclarativeRectangle*>("three"); + QVERIFY(three != 0); + QDeclarativeRectangle *four = canvas->rootObject()->findChild<QDeclarativeRectangle*>("four"); + QVERIFY(four != 0); + QDeclarativeRectangle *five = canvas->rootObject()->findChild<QDeclarativeRectangle*>("five"); + QVERIFY(five != 0); + + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(two->x(), 0.0); + QCOMPARE(two->y(), 50.0); + QCOMPARE(three->x(), 0.0); + QCOMPARE(three->y(), 100.0); + QCOMPARE(four->x(), 50.0); + QCOMPARE(four->y(), 0.0); + QCOMPARE(five->x(), 50.0); + QCOMPARE(five->y(), 50.0); + + QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid"); + QCOMPARE(grid->width(), 100.0); + QCOMPARE(grid->height(), 120.0); +} + void tst_QDeclarativePositioners::test_grid_spacing() { QDeclarativeView *canvas = createView(SRCDIR "/data/grid-spacing.qml"); |