diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-11-03 22:53:12 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-11-04 01:55:00 (GMT) |
commit | 4e8df537210736d8a723a409e5e01046efa44a39 (patch) | |
tree | 357c25e3fcc75e3a54bfe5a78f03ecd165ed3e95 /tests/auto/declarative/layouts | |
parent | afcbf6a97744a7b113dc5ce542618a5543aead91 (diff) | |
download | Qt-4e8df537210736d8a723a409e5e01046efa44a39.zip Qt-4e8df537210736d8a723a409e5e01046efa44a39.tar.gz Qt-4e8df537210736d8a723a409e5e01046efa44a39.tar.bz2 |
Position items in the correct order
Nearly fixes QT-2241, but still waiting for a signal to appear in
QGraphicsItem which allows up to reposition items after a change.
Diffstat (limited to 'tests/auto/declarative/layouts')
-rw-r--r-- | tests/auto/declarative/layouts/tst_layouts.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index b0df57ea..96729a3 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -58,6 +58,7 @@ private slots: void test_grid(); void test_grid_spacing(); + void test_repeater(); private: QmlView *createView(const QString &filename); }; @@ -222,6 +223,30 @@ void tst_QmlGraphicsLayouts::test_grid_spacing() QCOMPARE(five->y(), 54.0); } +void tst_QmlGraphicsLayouts::test_repeater() +{ + QmlView *canvas = createView("data/repeater.qml"); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsRectangle *one = canvas->root()->findChild<QmlGraphicsRectangle*>("one"); + QVERIFY(one != 0); + + QmlGraphicsRectangle *two = canvas->root()->findChild<QmlGraphicsRectangle*>("two"); + QVERIFY(two != 0); + + QmlGraphicsRectangle *three = canvas->root()->findChild<QmlGraphicsRectangle*>("three"); + QVERIFY(three != 0); + + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(two->x(), 50.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(three->x(), 100.0); + QCOMPARE(three->y(), 0.0); +} + QmlView *tst_QmlGraphicsLayouts::createView(const QString &filename) { QmlView *canvas = new QmlView(0); |