importQtQuick.Window2.0asMy的 QtQuick.Window2.0别名为 My引用.propertyaliasrectWidth:rect.width的 rect.width别名为 rectWidth引用.import QtQuick 2.5
import QtQuick.Window 2.0 as My
My.Window {
property alias rectWidth: rect.width
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Rectangle {
id: rect
width: 100; height: 200
color: "red"
}
}