summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-09 09:29:01 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-09 09:29:01 (GMT)
commit9b3a87a0f20023b59b3d59807aac69e53be277eb (patch)
tree169f34e9acd0a050ac93f4960459653957a15436 /tests/auto/declarative
parent89fa7ae6d922ff5b62fca65eab95f35845c069eb (diff)
parentaf05a5b1b4eec953c6ee0dc56ffbccda9b3a3dd9 (diff)
downloadQt-9b3a87a0f20023b59b3d59807aac69e53be277eb.zip
Qt-9b3a87a0f20023b59b3d59807aac69e53be277eb.tar.gz
Qt-9b3a87a0f20023b59b3d59807aac69e53be277eb.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/layouts/data/layouts.qml3
-rw-r--r--tests/auto/declarative/layouts/tst_layouts.cpp20
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()