Yes, I have tried that, thanks. bool TableProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); CustomModelItem* item = static_cast<CustomModelItem*>(index.internalPointer()); return !item->childCount(); }
The problem is the property. It is mixing two different things, so it does not suffice when one only needs one of those. If you filter without recursiveFilteringEnabled enabled (default, false), then it will only filter through the root node(s). So, you would not be able to filter in the children. If you set recursiveFilteringEnabled to true, then it will filter through the children, but then it will also include the parents of those children. So, what we need is being able to filter through children (i.e. recursive filtering), but without showing the parents. Does that make sense?
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development