summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp')
-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);