oKcerG / SortFilterProxyModel

A nicely exposed QSortFilterProxyModel for QML
MIT License
301 stars 102 forks source link

How can one use this for QVariantList? #90

Open thehamzan6 opened 3 years ago

thehamzan6 commented 3 years ago

Say I have an itemmodel that contains a QVariantList, let's called it "names" and I want to sort it using a combobox, how would one do so with the QSortFilterModel?

    SortFilterProxyModel {
        id: gamesProxyModel
        sourceModel: model
        filters: [
            AnyOf {
                 RegExpFilter {
                    roleName: "names"
                    pattern: comboBox.displayText
                    caseSensitivity: Qt.CaseInsensitive
                }
       ]
   }

This doesn't work when I try it like so.