tracing/Qbs: Turn crash in tst_flamegraphview into a failure

Don't crash if qml scene instantiation fails (e.g. when built with Qt 6
and Qbs). Just fail the test.

Change-Id: I444a6a68382c5acc9ca9faf9ce7c489a87fa5c98
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2022-07-18 00:09:07 +02:00
parent ae69073fc1
commit 9cb21d2879

View File

@@ -99,7 +99,8 @@ void tst_FlameGraphView::initTestCase()
void tst_FlameGraphView::testZoom()
{
auto selectedTypeId = [&]() {
return widget.rootObject()->property("selectedTypeId").toInt();
const QQuickItem *item = widget.rootObject();
return item ? item->property("selectedTypeId").toInt() : -1;
};
QWindow *window = widget.windowHandle();