QTreeView or QTreeWidget

旧街凉风 提交于 2019-12-05 03:45:19

If your data is stored in a database model or if you want to have a single data model and show it in some views in different ways, then you are definitely better to go with QTreeView.

But QTreeWidget has it's internal model in some way along with the methods to deal with model in context of indexes. In general if you just want something that is simple to work, you can use the widget way.

But the Model/View approach is more general and flexible IMO. You can create your own subclasses of model and view which enables you to do whatever you like.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!