summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@nokia.com>2010-07-12 12:35:33 (GMT)
committerRobert Griebl <robert.griebl@nokia.com>2010-07-12 12:35:33 (GMT)
commit07321dfceed41c1851781841e03c4148da47e41e (patch)
tree582964432da373f5e8979de156c30773ca8c9737 /tests
parentcbc7a0251a727827418707c7a05ea44241a06efb (diff)
downloadQt-07321dfceed41c1851781841e03c4148da47e41e.zip
Qt-07321dfceed41c1851781841e03c4148da47e41e.tar.gz
Qt-07321dfceed41c1851781841e03c4148da47e41e.tar.bz2
Calling setMinimumSize(0, 0) on a top-level window sometimes triggers a bug
in the Compiz window manager which leads to the QML viewer mainwindow not being composited anymore (at least until the next resize). Since we need to somehow switch between fixed size and freely resizable views, we have to work around that bug using the layout constraint hints. Task-number: QTBUG-11771 Reviewed-by: kkoehne
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
index 695c038..b08da0f 100644
--- a/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
+++ b/tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp
@@ -113,7 +113,6 @@ void tst_QDeclarativeViewer::orientation()
viewer->rotateOrientation();
qApp->processEvents();
- qApp->processEvents(); // one extra round for the delayed updateSizeHints() call
QCOMPARE(rootItem->width(), 300.0);
QCOMPARE(rootItem->height(), 200.0);
@@ -124,7 +123,6 @@ void tst_QDeclarativeViewer::orientation()
viewer->rotateOrientation();
qApp->processEvents();
- qApp->processEvents(); // one extra round for the delayed updateSizeHints() call
QCOMPARE(rootItem->width(), 200.0);
QCOMPARE(rootItem->height(), 300.0);
@@ -159,10 +157,10 @@ void tst_QDeclarativeViewer::loading()
// window resized
QTRY_COMPARE(rootItem->width(), 400.0);
- QTRY_COMPARE(rootItem->height(), 500.0-viewer->menuBar()->height());
- QCOMPARE(viewer->view()->size(), QSize(400, 500-viewer->menuBar()->height()));
+ QTRY_COMPARE(rootItem->height(), 500.0 - MENUBAR_HEIGHT(viewer));
+ QCOMPARE(viewer->view()->size(), QSize(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500-viewer->menuBar()->height()));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), QSize(400, 500));
QCOMPARE(viewer->size(), viewer->sizeHint());
@@ -176,7 +174,7 @@ void tst_QDeclarativeViewer::loading()
QCOMPARE(viewer->view()->size(), QSize(200, 300));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
- QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), viewer->sizeHint());
viewer->resize(QSize(400, 500));
@@ -184,10 +182,10 @@ void tst_QDeclarativeViewer::loading()
// window resized again
QTRY_COMPARE(rootItem->width(), 400.0);
- QTRY_COMPARE(rootItem->height(), 500.0-viewer->menuBar()->height());
- QCOMPARE(viewer->view()->size(), QSize(400, 500-viewer->menuBar()->height()));
+ QTRY_COMPARE(rootItem->height(), 500.0 - MENUBAR_HEIGHT(viewer));
+ QCOMPARE(viewer->view()->size(), QSize(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500-viewer->menuBar()->height()));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(400, 500 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), QSize(400, 500));
QCOMPARE(viewer->size(), viewer->sizeHint());
@@ -201,7 +199,7 @@ void tst_QDeclarativeViewer::loading()
QCOMPARE(viewer->view()->size(), QSize(200, 300));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(200, 300));
- QCOMPARE(viewer->size(), QSize(200, 300+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(200, 300 + MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), viewer->sizeHint());
delete viewer;
@@ -272,7 +270,7 @@ void tst_QDeclarativeViewer::resizing()
QTRY_COMPARE(viewer->view()->size(), QSize(150, 200));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(150, 200));
- QCOMPARE(viewer->size(), QSize(150, 200+viewer->menuBar()->height()));
+ QCOMPARE(viewer->size(), QSize(150, 200 + MENUBAR_HEIGHT(viewer)));
// do not size root object to view
viewer->resize(QSize(180,250));
@@ -286,10 +284,10 @@ void tst_QDeclarativeViewer::resizing()
qApp->processEvents();
QTRY_COMPARE(rootItem->width(), 250.0);
- QTRY_COMPARE(rootItem->height(), 350.0-viewer->menuBar()->height());
- QTRY_COMPARE(viewer->view()->size(), QSize(250, 350-viewer->menuBar()->height()));
+ QTRY_COMPARE(rootItem->height(), 350.0 - MENUBAR_HEIGHT(viewer));
+ QTRY_COMPARE(viewer->view()->size(), QSize(250, 350 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->view()->initialSize(), QSize(200, 300));
- QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350-viewer->menuBar()->height()));
+ QCOMPARE(viewer->view()->sceneRect().size(), QSizeF(250, 350 - MENUBAR_HEIGHT(viewer)));
QCOMPARE(viewer->size(), QSize(250, 350));
// do not size view to root object