Qt-interest Archive, April 2008
is QSortFilterProxyModel applicable?
Message 1 in thread
Hello all,
within our Qt4.3 app (windows XP), we implemented a custom
QStandardItemModel to display some data within a tree view as hierarchic
organized items.
It is slightly complex, about half a dozen different object types with
different DnD behavior, dependent on their hierarchic position, parent,
children, different attributes etc... ( the attributes again got
different properties in dependence of the object type, the parent, the
children etc... ;-) )
Now, a second view (table view) is desired to show parts of the data
which is organized in the tree model. Just items of some of our object
types shall be visible and, typically, these objects are organized in
lower hierarchic levels of the model. Imagine to cut of the root and its
direct children and flatten the residue down to a list in a table.
So, without much experience, I am searching for the "best" way to
implement that and got following questions:
- Is it possible to create one hierarchic source model and got some kind
of proxy model without hierarchy?
- Is it possible to reach the goal with some functionality which is
provided by QSortFilterProxyModel? I thaught of filterAcceptRows(...)
but it seems that children of a rejected parent are rejected, too? (I
can display the root item or nothing...)
- Is there any other (widely) matching model class?
Any hint is really appreciated, I don't have a clue...
Regards,
Marko
--
[ signature omitted ]