From 024daeb08c77b75638843f6b3d5a93129ffcb0eb Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 19 Jan 2019 19:54:59 +0100 Subject: [PATCH] tst_QGraphicsItem: stabilize cursor() test The cursor test sometimes fails due to the fact that the topLevel widget has not yet reached it's fullscreen geometry. This means the QGraphicsView is to small and the test will fail. Avoid it by simply removing the topLevel widget since it's not used at all. Change-Id: Ia7b34f283a917a35b6665e6333a01378575a5a04 Reviewed-by: Friedemann Kleint --- .../graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 5f269bd520..9a75774927 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -4148,11 +4148,9 @@ void tst_QGraphicsItem::ensureVisible() void tst_QGraphicsItem::cursor() { QGraphicsScene scene; - QWidget topLevel; - QGraphicsView view(&scene,&topLevel); - topLevel.showMaximized(); - QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); - view.setFixedSize(topLevel.size()); + QGraphicsView view(&scene); + view.showFullScreen(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); QGraphicsRectItem *item1 = scene.addRect(QRectF(-100, 0, 50, 50)); QGraphicsRectItem *item2 = scene.addRect(QRectF(50, 0, 50, 50));