Hi Lazlo,

How about  adding a custom proxy model that inherits from QSortFilterProxyModel 
and override filterAcceptRow() for required data (like here adding a condition 
to validate for leaf node)?

>From the stack overflow, I see your comment, that in practice it's not 
>possible, why do you think so?

Regards,
Santhosh.

From: Development <development-boun...@qt-project.org> On Behalf Of László Papp
Sent: 20 September 2023 15:55
To: development@qt-project.org
Subject: [Development] QSortFilterProxyModel: recursiveFilteringEnabled

Hi,

Would it make sense to split this property into two?

https://doc.qt.io/qt-6/qsortfilterproxymodel.html#recursiveFilteringEnabled-prop

A use case would be something like this:

https://stackoverflow.com/questions/3384005/qt-table-and-tree-view-with-the-same-model

You want to show the leaf nodes of a selected branch node of a tree view in a 
table view. Or all leaf nodes from the tree in the table view as in the above 
Stack Overflow question.

Currently, you need to set recursiveFilteringEnabled to true because:

> This property holds whether the filter to be applied recursively on children

Otherwise, the leaf nodes will not be checked, or any embedded branch node. But 
the problem is then this:

> and for any matching child, its parents will be visible as well.

I would not like to have the parents visible, only the leaf like in the above 
Stack Overflow question.

Thoughts? Thanks.

Kind regards,
László
-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to