• 7274阅读
  • 2回复

【提问】显示树型模型时在Model/View和QTreeWidget间如何做选择? [复制链接]

上一主题 下一主题
离线kytexzy
 

只看楼主 倒序阅读 楼主  发表于: 2006-02-08
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
我想实现一个有三层结构的的树型视图,QTreeWidget提供了一个自定义的model,请问在Model/View和QTreeWidget间做选择的一般原则?
[ 此贴被XChinux在2006-02-08 10:39重新编辑 ]
try to find forgiveness for yourself and forgive others
离线slient
只看该作者 1楼 发表于: 2007-05-31
In many situations, we only need to present relatively small numbers of items to the user. In these common cases, we can use Qt's convenience item view classes (QListWidget, QTableWidget, and QTReeWidget) and populate them with items directly.
For large data sets, duplicating the data is often not an option. In these cases, we can use Qt's views (QListView, QTableView, and QtreeView), in conjunction with a data model, which can be a custom model or one of Qt's predefined models. For example, if the data set is held in a database, we can combine a QTableView with a QSqlTableModel.
离线laurentium
只看该作者 2楼 发表于: 2009-06-16
其实插入项不多的话,QTreeWidget每次重刷一次就好了,比较简单
至少几百个还是可以接受的

不然就QTreeView,不用自己操心
但是很多东西就自己写吧
快速回复
限100 字节
 
上一个 下一个