Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
6.2.4
-
-
0ac01b27ef (qt/qtdeclarative/6.4) 5b24e324d3 (qt/qtdeclarative/dev) 5b24e324d3 (qt/qtdeclarative/wip/material3) 0ac01b27ef (qt/tqtc-qtdeclarative/6.4) 5b24e324d3 (qt/tqtc-qtdeclarative/dev)
Description
1) preset in QQuickWindow
: setPersistentGraphics(false)
: setPersistentSceneGraph(false)
2) Crash sequence
- Load Shape Component on Window is unvisible(visible: false)
- Change Window visible to true
- Crash
See this crash reproduce code.
(Run -> window hide after 2sec -> show and crash after 2sec)
//main.cpp #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQuickWindow> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(u"qrc:/QtTest/main.qml"_qs); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); QObject *root = engine.rootObjects()[0]; QQuickWindow *window = qobject_cast<QQuickWindow *>(root); window->setPersistentGraphics(false); window->setPersistentSceneGraph(false); return app.exec(); }
//main.qml import QtQuick import QtQuick.Window import QtQuick.Shapes Window { id: window visible: true width: 1920 height: 720-106 Loader { id: crashLoader anchors.fill: parent sourceComponent: crash active: false onActiveChanged: { console.log("crashLoader active is " + active) } } Timer { interval: 2000 repeat: true running: true onTriggered: { window.visible = !window.visible } } onVisibleChanged: { if(!visible) { crashLoader.active = true } } Component { id: crash Shape { width: 120 height: 130 anchors.bottom: parent.bottom anchors.right: parent.right layer.enabled: true layer.samples: 4 ShapePath { fillColor: "black" strokeColor: "darkBlue" strokeWidth: 20 capStyle: ShapePath.FlatCap PathAngleArc { centerX: 65; centerY: 95 radiusX: 45; radiusY: 45 startAngle: -180 sweepAngle: 180 Component.onCompleted: { console.log("created PathAngleArc") } } Component.onCompleted: { console.log("created ShapePath") } } Component.onCompleted: { console.log("created Shape") } } } }