qml 怎么判断listelement是否显示
答案:2 悬赏:30 手机版
解决时间 2021-01-23 18:26
- 提问者网友:骑士
- 2021-01-22 21:16
qml 怎么判断listelement是否显示
最佳答案
- 五星知识达人网友:逃夭
- 2021-01-22 22:00
我想用listview做一个点餐系统的商品浏览 即一行一行地显示食物的图片,在listModel中添加如下7个元素,但是显然这样不科学,我希望用一个循环来做这件事情,请问应该如何实现 在线等
ListElement { name: "梅菜扣肉"; pic: "pic/eat/eat4.jpg";money:"29" }
ListElement { name: "芝麻铁板牛肉"; pic: "pic/eat/eat5.jpg";money:"18" }
ListElement { name: "鳗鱼焗饭"; pic: "pic/eat/eat6.jpg";money:"32" }
ListElement { name: "秘制鸡煲"; pic: "pic/eat/eat7.jpg";money:"15" }
ListElement { name: "爆炒大肠"; pic: "pic/eat/eat8.jpg";money:"18" }
ListElement { name: "烤牛仔骨"; pic: "pic/eat/eat9.jpg";money:"32" }
ListElement { name: "蟹黄腐竹"; pic: "pic/eat/eat10.jpg";money:"15" }
ListElement { name: "梅菜扣肉"; pic: "pic/eat/eat4.jpg";money:"29" }
ListElement { name: "芝麻铁板牛肉"; pic: "pic/eat/eat5.jpg";money:"18" }
ListElement { name: "鳗鱼焗饭"; pic: "pic/eat/eat6.jpg";money:"32" }
ListElement { name: "秘制鸡煲"; pic: "pic/eat/eat7.jpg";money:"15" }
ListElement { name: "爆炒大肠"; pic: "pic/eat/eat8.jpg";money:"18" }
ListElement { name: "烤牛仔骨"; pic: "pic/eat/eat9.jpg";money:"32" }
ListElement { name: "蟹黄腐竹"; pic: "pic/eat/eat10.jpg";money:"15" }
全部回答
- 1楼网友:不甚了了
- 2021-01-22 23:05
问题已解决~iscurrentItem属性就可以解决
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯