[Qt-interest] hiding a QTableView row from the model?
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Fri May 22 18:33:36 CEST 2009
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of Paul Miller
> Sent: Friday, May 22, 2009 9:24 AM
> To: QT Interest List
> Subject: [Qt-interest] hiding a QTableView row from the model?
>
> I want to be able to hide some rows in my table based on data that is
in
> the model. I see from the documentation that the only way to hide a
row
> seems to be from the VIEW, which doesn't make much sense since
> everything else is in the model.
>
> In my case I want to hide rows that end up having all of their data
> values being "empty". I don't want to rebuild my model in this case,
or
> use a proxy model as computing all this data is quite expensive.
>
> Is there an elegant work-around for this problem?
>
> --
Its going to be tough inside the model, since any connected view would
get changed. Even if you have only 1 connection, the MVC is designed
for multiple views..
Im not sure why it would be more expensive inside the model than inside
a proxy model however...
Why not have a simple proxy that in the hideRow function simple checks
to see if any column has a value...
Scott
More information about the Qt-interest-old
mailing list