赞
踩
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 Window { visible: true width: 640 height: 480 title: qsTr("My QML") color: "white" Repeater { // model: 3 //模型 可以是很多类型 数字的话 表示有几个模型/控件 model: ["Button", "Rectangle", "MouseArea"] //数量还是3 读取list大小 Button { y: index * 50 //index表示第几个 width: 100; height: 40 // border.width: 1 // color: "yellow" text: modelData + index //获取List里的数据 } Component.onCompleted: { console.log(count) } } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。