Dynamically show/hide QTreeView items.
-
I have an application setting based on which I need to show/hide items in my QTreeView, but my model should remain same. I tried returning empty QVariant() in the decorationRole and displayRole and returning QSize(0,0) in sizeHintRole. But the invisible items do not resize to zero height. How do I achieve this?
-
For such things, you typically 8use a QSortFilterProxyModel in between. Have a look at "models and views":http://doc.qt.nokia.com/4.7/model-view-programming.html#proxy-models