summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
diff options
context:
space:
mode:
authorJoona Petrell <joona.t.petrell@nokia.com>2010-06-29 02:39:30 (GMT)
committerJoona Petrell <joona.t.petrell@nokia.com>2010-06-29 03:10:19 (GMT)
commitf54353bf2f566335e44d20b5263fe19d5ac33d1e (patch)
tree5470e997ef138b2d0a6562ef4f24cb2f747fcc41 /tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
parentb1b46d4e5bd9e4ef355d8bbc13900d7489fb4bf9 (diff)
downloadQt-f54353bf2f566335e44d20b5263fe19d5ac33d1e.zip
Qt-f54353bf2f566335e44d20b5263fe19d5ac33d1e.tar.gz
Qt-f54353bf2f566335e44d20b5263fe19d5ac33d1e.tar.bz2
Fix flow layout not taking into account whether it's width and height are implicit or not.
Task-number: QTBUG-11778 Reviewed-by: Martin Jones
Diffstat (limited to 'tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 62ec707..0663991 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -75,6 +75,7 @@ private slots:
void test_repeater();
void test_flow();
void test_flow_resize();
+ void test_flow_implicit_resize();
void test_conflictinganchors();
private:
QDeclarativeView *createView(const QString &filename);
@@ -655,6 +656,28 @@ void tst_QDeclarativePositioners::test_flow_resize()
delete canvas;
}
+void tst_QDeclarativePositioners::test_flow_implicit_resize()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/flow-testimplicitsize.qml");
+ QVERIFY(canvas->rootObject() != 0);
+
+ QDeclarativeFlow *flow = canvas->rootObject()->findChild<QDeclarativeFlow*>("flow");
+ QVERIFY(flow != 0);
+
+ QCOMPARE(flow->width(), 100.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ canvas->rootObject()->setProperty("leftToRight", true);
+ QCOMPARE(flow->width(), 220.0);
+ QCOMPARE(flow->height(), 50.0);
+
+ canvas->rootObject()->setProperty("leftToRight", false);
+ QCOMPARE(flow->width(), 100.0);
+ QCOMPARE(flow->height(), 120.0);
+
+ delete canvas;
+}
+
QString warningMessage;
void interceptWarnings(QtMsgType type, const char *msg)