I want to implement in my program a tree with nested sub-levels, and I\'m looking for which of those two kind(View/Widget) is best suited for my goal.
I have a list of d
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.