Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7.1, 5.8.0 RC
-
None
-
macOS 10.12.2
Qt 5.8
Description
Consider the following code:
ModalWindow.qml
import QtQuick 2.0 import QtQuick.Window 2.2 Window { width: 100 height: 100 modality: Qt.WindowModal visible: true Rectangle { anchors.fill: parent color: "#1f1f1f" } Text { anchors.centerIn: parent text: "Modal Window" color: "#ffffff" } }
main.qml
import QtQuick 2.0 import QtQuick.Window 2.2 Window { id: rootWindow visible: true width: 640 height: 480 title: "Root Window" ModalWindow {} }
WindowModal windows on macOS look as if they were embedded into their parent windows (see WindowModal.jpg in attachment). If you create another instance of ModalWindow.qml as
Component.onCompleted: { var windowComponent = Qt.createComponent("ModalWindow.qml") var window = windowComponent.createObject(rootWindow.contentItem) }
it will look the same.
Now, if you use Loader to instantiate it
Loader {
anchors.fill: parent
source: "ModalWindow.qml"
}
ModalWindow will be created as a separate window (see WindowModalBroken.jpg in attachment) which is incorrect.
I found this during of debugging QTBUG-56166
Attachments
Issue Links
- is duplicated by
-
QTBUG-52944 Transient parent of Window is not clear when Loader is involved
- Closed