Use a custom model derived from QAbstractItemModel, then you will have complete control over how to iterate though the data/rows and will also have control when to inform the view/display to update itself. But be aware writing custom QAbstractItemModel is not as stright forward as using QStandardItemModel/QTreeWidget. When using custom QAbstractItemModel you will need to implement certain virtual functions, which you can and figure out form Qt documentation.The recommended way is to avoid QStandardItemModel. Fine. The recommended way seems to avoid QTreeWidget too. What else shall be avoided, or more helpful what shall be used?
Refer Simple Tree Model Example





Reply With Quote
Bookmarks