How can I create a new window from within QML?
问题 Is there a way to create a completely new window instance, as a child window of the main QML window in a QmlApplication? // ChildWindow.qml Rectangle { id: childWindow width: 100 height: 100 // stuff } // main.qml Rectangle { id: window width: 1000 height: 600 MouseArea { anchors.fill: parent onClicked: createAWindow(childWindow); } } I am trying to avoid writing a Q_OBJECT class just for instanciating the new window within a new QmlApplicationViewer . 回答1: There is no way to create top-level