[Qt-interest] how to use setRowHidden in a model/view/delegate

TP paratribulations at free.fr
Tue Apr 7 15:15:19 CEST 2009


Hi everybody,

I use a model/view/delegate with QAbstractItemModel as model and QTreeView
as view.
I want to hide some rows when some conditions are satisfied. I found it
convenient to do it by using setRowHidden(...) in the index() function of
the model. For this, it was mandatory to make the view available from the
model. It works: the rows are hidden, but I obtain an infinite recursion
that slows down my QTreeView.
Is it usual to give access to the view in the model? If yes, what is the
problem with calling setRowHidden() from the index() function (why an
infinite recursion)? How do you proceed?

Thanks in advance

Julien
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
9&1+,\'Z4(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)




More information about the Qt-interest-old mailing list