Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.8
-
None
Description
If the root object of a Qml document is unknown to QQuickWidget (e.g. if it's not a QQuickItem or a QWindow), then setSource fails with segmentation fault. An example is the existing QML file in the QtDeclarative source code:
qtdeclarative/src/quickdialogs/quickdialogsquickimpl/qml/+Fusion/ColorDialog.qml
The root object in this file is ColorDialogImpl, as a result, when I try to load the file in a QQuickWidget (QQuickWidget::setSource), I get segmentation fault.
The segfault happens with the following message:
QQuickWidget only supports loading of root objects that derive from QQuickItem.
Ensure your QML code is written for QtQuick 2, and uses a root that is or
inherits from QtQuick's Item (not a Timer, QtObject, etc).
Stack trace:
https://dpaste.org/XEJvB
The code and more info can be found under the patch:
https://codereview.qt-project.org/c/qt/qttools/+/624096/comments/9f458086_57a4276d
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-133832 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
630660,6 | fix QQuickWidget memory corruption in setSource | dev | qt/qtdeclarative | Status: NEW | +1 | 0 |