QM关于Repeater的使用

网友投稿 652 2022-09-27

QM关于Repeater的使用

QM关于Repeater的使用

我们在使用qml画界面的时候会经常用到很多重复的组件,下面我们来了解一种可以快速布局的的Repeater

:下面是我写的一个实例

main.aml

import QtQuick 2.7import QtQuick.Controls 1.5import QtQuick.Layouts 1.0ApplicationWindow { visible: true width: 640 height: 480 id:root Rectangle{width: root.width; height: root.height;color: "#3A3250"; Column { anchors.fill: parent spacing: 10 Repeater { id: mainRepeater model: 3 delegate: IOcase{//IOLNormalCase这是一个qml id: iolCalItem width: root.width height: (root.height ) / 3 modelType: Math.pow(2,index) viewModel: iolCalItem.modelType == 1 ? 7 : 6 } } } }}

IOcase.qml

贴一个结果:

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:SpringBoot加密配置文件的SQL账号密码方式
下一篇:tabWidget设置文字方向
相关文章

 发表评论

暂时没有评论,来抢沙发吧~