【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
import QtQuick 2.0
Item {
width:100
height: 200
// Component.onCompleted:
// {
// // var component = Qt.createComponent("Inner.qml");
// console.log("Completed Running!")
// // var obj = component.createObject(parent)
// }
// Rectangle{
// color: "green"
// width: 200
// height: 100
function changePage() {
loder_id.source = "Inner2.qml";
}
MouseArea {
anchors.fill: parent
// onClicked: changePage();
onClicked: {
loder_id.source = "Inner2.qml"
}
}
Loader{
// var component = Qt.createComponent("Inner.qml");
// console.log("Completed Running!");
// var obj = component.createObject(parent);
source: "Inner.qml"
id: loder_id
}
// }
}
来源:oschina
链接:https://my.oschina.net/itfanr/blog/3144045