PDA

View Full Version : Suppress drawing of rows



Strongoloid
17th August 2009, 20:54
How does one suppress the drawing of rows in a QTreeView? I have a custom QAbstractItemModel set up with each node being a QStandardItem. Child nodes are added with appendRow. I would like to be able to add children to certain nodes, but basically have them not be represented in the view. I've tried subclassing the view and playing with drawRow and such, but have had no success. The most I could make happen was to have it draw blank rows, but the space for the rows was still there. I also have delegates set up for certain nodes.

Lykurg
17th August 2009, 21:45
How does one suppress the drawing of rows in a QTreeView?

Hi, you could use QSortFilterProxyModel for filtering the non wanted rows out.

Strongoloid
17th August 2009, 22:04
Thanks, I will try that. I'm guessing I will need to reimplement the filterAcceptsRow function.