Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.2
-
None
-
Qt 6.2.2
macOS 12.1 (M1 chip)
Description
This is a regression experienced when upgrading from Qt 5.15.2 to 6.2.2.
I have my own style for QtQuickControls 2 as described in the docs. I have a fallback in my qmldir file:
module QtQuick.Controls.MyStyle
# Does not need to override anything to reproduce the bug
# Fallback
import QtQuick.Controls.Basic auto
I then try to use the Overlay.modal attached property in a Popup:
import QtQuick import QtQuick.Controls.MyStyle Window { width: 640 height: 480 visible: true title: qsTr("Hello World") // Code copied from: https://doc.qt.io/qt-6/qml-qtquick-controls2-overlay.html#modal-attached-prop Popup { id: popup width: 400 height: 400 modal: true visible: true Overlay.modal: Rectangle { color: "#aacfdbe7" } } }
This crashes the app with the following error messages:
QQmlApplicationEngine failed to load component qrc:/ModalDemo/main.qml:21:9: Non-existent attached object
I attached a minimal reproduction example project.
Workaround
import QtQuick import QtQuick.Controls.MyStyle import QtQuick.Controls as C Window { width: 640 height: 480 visible: true title: qsTr("Hello World") // Code copied from: https://doc.qt.io/qt-6/qml-qtquick-controls2-overlay.html#modal-attached-prop Popup { id: popup width: 400 height: 400 modal: true visible: true C.Overlay.modal: Rectangle { color: "#aacfdbe7" } } }
This works as intended.