背景: 我想創建一個使用qt的跨平臺應用程序。發現如何通過qml在移動設備上創建新窗口?
解決方案我:
MouseArea {
id: toOtherViewClicked
width: 44
anchors.fill: parent
onClicked: {
var component = Qt.createComponent("listOfMaterials.qml")
var window = component.createObject("secondQML")
window.show()
}
}
的問題 它的行爲很古怪。窗口顯示幾分鐘,然後再次返回主窗口。是否有可能以適當的方式展示新窗口?
請提供[完整的示例](http://stackoverflow.com/help/mcve)。另外,當窗口消失時,您是否看到任何錯誤消息? – Mitch