From ca7a2f84de58a9af35ff5ac0b0479c89c20e2b08 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 14 Jul 2022 09:11:40 +0200 Subject: [PATCH] QGraphicsWidget: skip test if graphics view fails to show We set Qt::X11BypassWindowManagerHint on the view, which regularly makes the test fail on X11 systems in the QVERIFY(QTest::qWaitForWindowActive(dummyView.data())) check. If the view fails to show, skip the test instead of failing, we are not testing anything X11 specific here, running this test on other platforms will be good enough. Fixes: QTBUG-98921 Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea Reviewed-by: Fabian Kosmale (cherry picked from commit a2c7428e4dcfb30fa391083aff6618c1f54e777a) Reviewed-by: Qt Cherry-pick Bot --- .../graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index 9553b939e21..89548337aa1 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -3099,7 +3099,8 @@ void tst_QGraphicsWidget::initialShow() EventSpy paintSpy(dummyView->viewport(), QEvent::Paint); dummyView->show(); qApp->setActiveWindow(dummyView.data()); - QVERIFY(QTest::qWaitForWindowActive(dummyView.data())); + if (!QTest::qWaitForWindowActive(dummyView.data())) + QSKIP("Graphics view failed to show (possibly due to Qt::X11BypassWindowManagerHint"); const int expectedRepaintCount = paintSpy.count(); dummyView.reset();