diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-09 08:56:13 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-09 08:56:13 (GMT) |
commit | af05a5b1b4eec953c6ee0dc56ffbccda9b3a3dd9 (patch) | |
tree | d2d96a81449a811fc1800c9756b4ea2c7e575b14 | |
parent | 1e8c3068f0223c9b6749bf522f7ff391497e5440 (diff) | |
parent | 7d29b8b5ef86c291c517378a8b06d0b22070c169 (diff) | |
download | Qt-af05a5b1b4eec953c6ee0dc56ffbccda9b3a3dd9.zip Qt-af05a5b1b4eec953c6ee0dc56ffbccda9b3a3dd9.tar.gz Qt-af05a5b1b4eec953c6ee0dc56ffbccda9b3a3dd9.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | tests/auto/declarative/layouts/data/layouts.qml | 3 | ||||
-rw-r--r-- | tests/auto/declarative/layouts/tst_layouts.cpp | 20 |
2 files changed, 13 insertions, 10 deletions
diff --git a/tests/auto/declarative/layouts/data/layouts.qml b/tests/auto/declarative/layouts/data/layouts.qml index ccc8cfe..b0ee63b 100644 --- a/tests/auto/declarative/layouts/data/layouts.qml +++ b/tests/auto/declarative/layouts/data/layouts.qml @@ -7,10 +7,9 @@ Item { GraphicsObjectContainer { anchors.fill:parent + synchronizedResizing: true QGraphicsWidget { - size.width:parent.width - size.height:parent.height layout: QGraphicsLinearLayout { spacing: 0 diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index f619b57..1c2330d 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -68,10 +68,10 @@ void tst_QmlGraphicsLayouts::test_qml() canvas->execute(); qApp->processEvents(); - QmlGraphicsLayoutItem *left = qobject_cast<QmlGraphicsLayoutItem*>(canvas->root()->findChild<QmlGraphicsItem*>("left")); + QmlGraphicsLayoutItem *left = static_cast<QmlGraphicsLayoutItem*>(canvas->root()->findChild<QmlGraphicsItem*>("left")); QVERIFY(left != 0); - QmlGraphicsLayoutItem *right = qobject_cast<QmlGraphicsLayoutItem*>(canvas->root()->findChild<QmlGraphicsItem*>("right")); + QmlGraphicsLayoutItem *right = static_cast<QmlGraphicsLayoutItem*>(canvas->root()->findChild<QmlGraphicsItem*>("right")); QVERIFY(right != 0); qreal gvMargin = 9.0; @@ -101,17 +101,21 @@ void tst_QmlGraphicsLayouts::test_qml() QCOMPARE(right->width(), 100.0); QCOMPARE(right->height(), 100.0); - //Maximum Size - canvas->root()->setWidth(1000 + 2*gvMargin); - canvas->root()->setHeight(1000 + 2*gvMargin); + //Between preferred and Maximum Size + /*Note that if set to maximum size (or above) GraphicsLinearLayout behavior + is to shrink them down to preferred size. So the exact maximum size can't + be used*/ + canvas->root()->setWidth(670 + 2*gvMargin); + canvas->root()->setHeight(300 + 2*gvMargin); QCOMPARE(left->x(), gvMargin); - QCOMPARE(left->width(), 300.0); + QCOMPARE(left->width(), 270.0); QCOMPARE(left->height(), 300.0); - QCOMPARE(right->x(), 300.0 + gvMargin); + QCOMPARE(right->x(), 270.0 + gvMargin); QCOMPARE(right->width(), 400.0); - QCOMPARE(right->height(), 400.0); + QCOMPARE(right->height(), 300.0); + } void tst_QmlGraphicsLayouts::test_cpp() |