SortFilterProxyModel
SortFilterProxyModel copied to clipboard
ValueFilter does not show results in a hierarchical model
Consider a Tree model with the following structure
- node1
- starred {true}
- parent1
- node2
- starred {true}
- node3
- starred {false}
- parent2
- node4
- starred {true}
- node5
- starred {true}
By using the below ValueFilter
filters: [
ValueFilter {
roleName: "starred"
value: true
},
I expect the result as
- node1
- starred {true}
- parent1
- node2
- starred {true}
- parent2
- node4
- starred {true}
- node5
- starred {true}
But what I see is,
- node1
- starred {true}
- node5
- starred {true}
It does apply the filter only on the top level and not those below.
I could fix this by calling setRecursiveFilteringEnabled(true);
in the constructor of QQmlSortFilterProxyModel
Searching withRegExpFilter
filter works fine and shows results in all levels correctly.