QML Training Course 4 Basic objects

ListModel

  • Simple container for ListElements
  • count 属性
  • useful methods: append (jsonobject dict), insert(int index, jsonobject dict), clear(), object get(int index)

ComboBox

  • provides a list of options
  • 使用 data model 数据模型 填充
  • useful methods: find(string text), selectAll(), textAt(int index)
  • useful properties: count, currentIndex, currentText, model

Repeater

  • 用于创建 大量相似的 items
  • a repeater 拥有 a model and a delegate
  • methods: itemAt(index)
  • 属性: count, delegate, model

Grid

  • position child items in grid 网格
  • 使child items在grid中, 按 从左到右, 从上往下 排列
  • 每一个child item 在其对应的网格中, 在top-left (0, 0)位置

Keys

  • Keys键盘 可以用 onPressed 和 onReleased signal properties来处理

Loader

  • 动态load QML components
  • 通过 source属性 load QML file 或者 通过sourceComponent 属性 load Component object
  • 如果 source / sourceComponent change, 以前已经初始化的item 会被 destroy

 

loader用于延迟 component的创建.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值