有没有办法创建一个全新的窗口实例,作为QmlApplication中主QML窗口的子窗口?
// 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); } }
我正在尝试避免编写一个Q_OBJECT类,仅用于在新的QmlApplicationViewer中实现新窗口.
没有办法仅使用内置的QML功能来创建顶级窗口.
然而,有一个名为Desktop Components的Qt Labs项目,其中包含一个Window component,它允许您创建新的顶级窗口.