Unsolved I want to hide a specific node in QTreeView - C++ - QT
-
Hello,
i want to hide a specific node in QTreeView.
For example i have a node called "Positions" in my QTreeView. I want to hide this node, so that the user can't see it by his name.
Is it possible? And if yes it is possible with the name or only with the index?Regards
-
@developer_96
Well, I don't know if this is the best way, but you can always use aQSortFilterProxyModel
to filter data items out. Might depend on what kind of "hide" you mean in a treeview. -
With "hide" i want to achive that the user can't see the whole node i want to hide. I look to QSortFilterProxyModel i think with that i can be solved :)
-
@developer_96
If it is a node and you want its children to be filtered out too, you may need to setsetRecursiveFilteringEnabled(true)
.
UPDATE
Or, you might not want that, and better left on defaultsetRecursiveFilteringEnabled(false)
?! -
Thank you @JonB that is exactly what i want, to filter the node with its children out.