效果:点击按钮载入一个qml文件(一个窗口)
MyButton
{
text:"动画01"
onBtnclicked://信号首字母大写
{
var component = Qt.createComponent("Animation01.qml");
var win = component.createObject();
win.closing.connect(function() { console.log('窗口关闭了') })
win.show();
}
}
类似于c++代码:
QWidget * w = new QWidget;
w->show();