PDA

View Full Version : Model/View: display data in different views depending on content



RThaden
16th January 2008, 10:16
Hi all,

I have a custom model derived from QAbstractTableModel and I use several views to display the data.
For sake of simplicity let's assume that the table has an int and a string where the int ranges from 1 to 4.
Then, I need 4 views and each view shall only show the rows with the corresponding int, that is, view1 shows all rows containing the int 1, etc.
I assume that this can be done with different roles.
How can I tell the view to show only a subset of the whole data in the model?

Thanks in advance.

Rainer

RThaden
16th January 2008, 11:48
Hi all,

just found QSortFilterProxyModel. :o I guess that is the right way.
Will try that.

Regards,

Rainer