summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 953791818e..0010718d3e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -8299,20 +8299,14 @@ void tst_QGraphicsItem::sorting()
_paintedItems.clear();
- view.viewport()->repaint();
-#if defined(Q_OS_MAC)
- // There's no difference between repaint and update on the Mac,
- // so we have to process events here to make sure we get the event.
- QTest::qWait(100);
-#endif
-
+ view.viewport()->update();
const GraphicsItems expected{grid[0][0], grid[0][1], grid[0][2], grid[0][3],
grid[1][0], grid[1][1], grid[1][2], grid[1][3],
grid[2][0], grid[2][1], grid[2][2], grid[2][3],
grid[3][0], grid[3][1], grid[3][2], grid[3][3],
grid[4][0], grid[4][1], grid[4][2], grid[4][3],
item1, item2};
- QCOMPARE(_paintedItems, expected);
+ QTRY_COMPARE(_paintedItems, expected);
}
void tst_QGraphicsItem::itemHasNoContents()
@@ -8339,13 +8333,7 @@ void tst_QGraphicsItem::itemHasNoContents()
_paintedItems.clear();
- view.viewport()->repaint();
-#ifdef Q_OS_MAC
- // There's no difference between update() and repaint() on the Mac,
- // so we have to process events here to make sure we get the event.
- QTest::qWait(10);
-#endif
-
+ view.viewport()->update();
QTRY_COMPARE(_paintedItems, GraphicsItems{item2});
}