Item 属性:
Item 类型比较特殊,因为它是所有其他可视化类型的基类型。
Qt Quick中所有可视化类型都基于 Item。
Item 对象本身没有一个可视化的外观,但是它定义了可视化项目中所有常见的特性,比如 x 、y 、width 、height 、anchors 和键盘处理等。
Item 类型最常见的用法是作为其他项目的容器,这样就可以把其他项目作为一个整体
Item { children: [ Image { source: "images/about.png" }, Image { x: 190 100 height: 100 fillMode: Image.Tile source: "images/about.png" } ] Component.onCompleted: { console.log("width = :", children[1].width) // children[1]来访问组中的对象 } }