Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business


OverviewFelgo 3 Support (Qt 5) › Filtering JSON list model in repeater!

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #24316




    I’ve Have a JonListModel, used together with the SortFilterProxyModel; This model & listview are used multiple times on a single page, via a repeater (they’re horizontal scrolls).

    What I am looking to achieve is each row has a different expression filter active¬†– as this is an ‘explore’ section; I am able to apply a single filter across all lists, however without having to include several coded lists one the page I was hoping to be able to just adjust the same one each time is appears, code below:


    property var arr: [{"hair": "Hairstylists"},{"mua": "Makeup Artists}]
    Column {
        id: content
        width: parent.width
        Repeater {
            id: repeater
            model: arr.length
            Rectangle {
                width: parent.width
                height: parent.height / 3
                Column {
                    id: contentCol
                    anchors.fill: parent
                    AppText {
                        text: Object.values(arr[index]) // the Object.key of my 'index' is what i wish to use as the filter for each row, passed over to 'HomeFlickable{ }'
                    HomeFlickable {  }



    JsonListModel {
        id: jsonModel
        source: feed2
        keyField: "id"
        fields: ["id", "owner", "tag"]
    SortFilterProxyModel {
        Component.onCompleted: sourceModel = jsonModel
        filters: ExpressionFilter {expression: model.tag === "makeup"} //this obviously filters those with a defined tag


    From the above example, when defining the filter “makeup” it works as you would expect, however what I am looking to do is somehow take the Object.keys() of ‘arr’ and apply that as the filter in ‘HomeFlickable’ for each time it is loaded!






    Hi Guys,


    I’ve solved this issue by instead of having the full code my my ‘AppListView’ multiple times over, applying multiple ‘SortFilterProxyModels’ depending on the repeater index, I am still unable to make it fully dynamic – however being something that doesn’t need frequent change it’s find with hardcode options instead!


Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded