当前位置: 首页 > news >正文

QML-各类布局

 Colunm布局

   Column{id:colspacing: 30Repeater{id:repmodel: ListModel{}Button{width: 100height: 50text: "btn"+index}}//开始时候移动move: Transition {NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }}//添加时变化add:Transition {NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce }}populate: Transition {NumberAnimation { properties: "x,y"; from:200;duration: 100; easing.type: Easing.OutBounce }}}Button{anchors.bottom: parent.bottomanchors.left: parent.leftanchors.bottomMargin: 20onClicked: {rep.model.insert(0,{"name":rep.model.count})}}

Flow布局

    Flow {anchors.fill: parentanchors.margins: 4spacing: 10flow:Flow.TopToBottom//上到下Text { text: "Text"; font.pixelSize: 40 }Text { text: "items"; font.pixelSize: 40 }Text { text: "flowing"; font.pixelSize: 40 }Text { text: "inside"; font.pixelSize: 40 }Text { text: "a"; font.pixelSize: 40 }Text { text: "Flow"; font.pixelSize: 40 }Text { text: "item"; font.pixelSize: 40 }}

Grid布局

    Grid {columns: 3//默认四个spacing: 2Rectangle { color: "red"; width: 50; height: 50 }Rectangle { color: "green"; width: 20; height: 50 }Rectangle { color: "blue"; width: 50; height: 20 }Rectangle { color: "cyan"; width: 50; height: 50 }Rectangle { color: "magenta"; width: 10; height: 10 }}

http://www.lryc.cn/news/392305.html

相关文章:

  • el-table封装点击列筛选行数据功能,支持筛选,搜索,排序功能
  • 【SpringBoot3学习 | 第1篇】SpringBoot3介绍与配置文件
  • SpringBoot整合Dubbo的快速使用教程
  • 昇思25天学习打卡营第12天| 基于MindNLP+MusicGen生成自己的个性化音乐
  • 代理设计模式和装饰器设计模式的区别
  • [Microsoft Office]Word设置页码从第二页开始为1
  • 【C++】日期类
  • 力扣热100 滑动窗口
  • 三万字带你一遍跑通uer
  • Ubuntu24.04LTS基础软件下载
  • SQLAlchemy配置连接多个数据库
  • NLP+LLM从入门到精通系列
  • 用数组手搓一个小顶堆
  • 【Linux开发】基于ALSA库实现音量调节
  • 代理IP在未来将面临哪些挑战?
  • FineBI在线学习资源-数据处理
  • 【代码随想录算法训练营第37期 第四十五天 | LeetCode198.打家劫舍、213.打家劫舍II、337.打家劫舍III】
  • Elasticsearch查询上下文和_source
  • golang实现网卡流量监控
  • 技术分享:直播平台如何开发并接入美颜SDK
  • 左耳听风_114_113_Go编程模式修饰器
  • Java实习手册(小白也看得懂)
  • Elasticsearch 分析器(Analyzer)的作用和配置
  • SpringBoot(一)创建一个简单的SpringBoot工程
  • 简述Vue中的数据双向绑定原理
  • C++STL函数对象的应用
  • AJAX-day1:
  • 昆虫学(书籍学习资料)
  • springboot + mybatis 多数据源切换
  • windows电脑网络重置后wifi列表消失怎么办?