Details
-
User Story
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
I would like to achieve something like this in my project:
https://stackoverflow.com/questions/3384005/qt-table-and-tree-view-with-the-same-model
It seems that QSortFilterProxtModel does not offer this directly because:
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.
There are some existing implementations that could be source of inspiration for a public API:
KDescendantsProxyModel
https://api.kde.org/frameworks/kitemmodels/html/classKDescendantsProxyModel.html
QQmlTreeModelToTableModel
https://github.com/qt/qtdeclarative/blob/dev/src/qmlmodels/qqmltreemodeltotablemodel.cpp
It is not an option for us to depend on Qml (QtDeclarative) or KDE (KItemModels).
Then, there is us, and there is also the StackOver flow question, so at least four different places where this has been needed. I believe it would make sense to have some public model for this in Qt itself, agnostic of Qml as we have been developing a widget-based application. I am probably biased, but a few use cases seem to justify not reinventing it elsewhere (Qml, KDE, StackOverflow, me, etc).
Any thoughts?
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-117716 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
511811,4 | WIP: New proxy model: QFlattenProxyModel | dev | qt/qtbase | Status: NEW | -2 | 0 |