oKcerG / SortFilterProxyModel

A nicely exposed QSortFilterProxyModel for QML
MIT License
298 stars 101 forks source link

Hierachichal Data Filter #66

Open khalili-mahdi opened 5 years ago

khalili-mahdi commented 5 years ago

can i use filtering and sorting to a hierarchical source? this is just for example my model is ListModel not json :

        {
            "identifier": 2,
            "childs": [{
                    "identifier": 201,
                    "name": "a",
                    "image": "\ueae5",
                    "levels": [{
                            "level": 1,
                            "push": "surathesab.qml"
                        }
                    ]
                }]

        }, {
            "identifier": 3,
            "name": "b",
            "image": "\uf02c",
            "childs": [{
                    "identifier": 301,
                    "name": "c",
                    "image": "\uf53c",
                    "levels": [{
                            "level": 1,
                            "push": "check.qml"
                        }
                }]

        }

final output should be name=="a" and name=="c" so in this data i should see levels!=null which i go with this :

ValueFilter{
                    roleName: "levels"
                    value: !null
                }

but , name == "c" is a child how can i handle it?