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.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-98921
Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Volker Hilsheimer 2022-07-14 09:11:40 +02:00
parent 845ea89211
commit a2c7428e4d

View File

@ -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();