summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@nokia.com>2010-07-30 08:37:40 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-02 14:30:18 (GMT)
commiteac4fdc9becea59573a945dff0294e7c3d17ea5b (patch)
tree4fbb05b78e274ebe329d29b525fde5df624b55ec /tests/auto
parent8c14359f0a43e3a7d196b39cb197d41ff6e4fbea (diff)
downloadQt-eac4fdc9becea59573a945dff0294e7c3d17ea5b.zip
Qt-eac4fdc9becea59573a945dff0294e7c3d17ea5b.tar.gz
Qt-eac4fdc9becea59573a945dff0294e7c3d17ea5b.tar.bz2
Fixed QGraphicsScene autotest to use a dummy toplevel widget
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index 09cf4e2..6a2f849 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -2694,12 +2694,14 @@ void tst_QGraphicsScene::render()
QPixmap pix(30, 30);
pix.fill(Qt::blue);
- QGraphicsScene scene;
+ QGraphicsView view;
+ QGraphicsScene scene(&view);
scene.addEllipse(QRectF(-10, -10, 20, 20), QPen(Qt::black), QBrush(Qt::white));
scene.addEllipse(QRectF(-2, -7, 4, 4), QPen(Qt::black), QBrush(Qt::yellow))->setZValue(1);
QGraphicsPixmapItem *item = scene.addPixmap(pix);
item->setZValue(2);
item->setOffset(QPointF(3, 3));
+ view.show();
scene.setSceneRect(scene.itemsBoundingRect());
@@ -2820,6 +2822,8 @@ void tst_QGraphicsScene::contextMenuEvent()
QGraphicsView view(&scene);
view.show();
+ QTest::qWaitForWindowShown(&view);
+ view.activateWindow();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
@@ -2851,12 +2855,14 @@ void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations()
item->setFlag(QGraphicsItem::ItemIgnoresTransformations);
scene.addItem(item);
- QGraphicsView view(&scene);
+ QWidget topLevel;
+ QGraphicsView view(&scene, &topLevel);
view.resize(200, 200);
- view.show();
+ topLevel.show();
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
+ QTest::qWaitForWindowShown(&topLevel);
{
QPoint pos(50, 50);