Reputation: 669
Good day, i have a model for QTreeView, i add QSortFilterProxyModel for this widget, hiding the branches and thus a would have a QTreeView like QListView but with headers.All work properly, now i would like to add new extra row(which displaying on my view, when clicking on this row i move up to the parent of this nodes).How to impliment this behavior:1)Add extra row;2)Clicking on the view and move up to the parent and displaying new nodes.
Upvotes: 2
Views: 2046
Reputation: 12547
When I met same problem, I designed new ProxyModel, which only purpose was to add empty row after proxies previous rows from source model. Then you can insert this model between view and sorting model.
Upvotes: 1