首页| 论坛| 消息

标题:QML中的VisualDataModel(已解决)
作者:sikylori
日期:2011-06-28 15:55
内容:

本人最近使用QML进行开发,在开发中遇到一个VisualDataModel的问题,请各位帮帮忙看看问题究竟出现在哪里,问题如下:将Qt中QStringList赋给VisualDataModel的model,然后显示出来,问题就在于我在Qt中改变VisualDataModel的model时,QML中显示出来的结果跟想象的不一样,而且结果是没规律,不知道大家有没有遇到过这样的问题(不知道大家有没有在用QML开发,如果有的话可以留下QQ号码大交流交流,QQ号:305938847),急用,源码如下:
testVisualDataModel.qml:

import Qt 4.7
Rectangle {
width: 1024; height: 600;
color: "black";
VisualDataModel {
id: visualModel
model: testVisualData.listModel;
delegate: Rectangle {
height: 25; width: 100
Text { text: "Name: " + modelData }
}
onCountChanged: console.log("onCountChanged: " + count);
}
ListView {
x: 0; y: 0; width: 200; height: 200;
model: visualModel
}
Rectangle {//清空visualModel的model
x: 500; y: 10; width: 100; height: 30;
color: "black"; border.width: 2; border.color: "white";
&nb ..


#1 [goready 08-29 16:15]
ding,人气

回复 发表
主题 版块