qml 怎么判断listelement是否显示
2个回答
展开全部
我想用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" }
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
问题已解决~iscurrentItem属性就可以解决
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询