QML GridView and QSortFilterProxyModel



  • Hi,

    is it not possible to use a QSortFilterProxyModel as the model of a QML GridView?

    I want the sorting to be column by column, so if a column has n rows then items with the sorting index 1 to n fill the first column. Then the item with the index (n+1) starts the next / second column.

    Here the TableView and TreeView are declared as supporting the setSortingEnabled property:
    http://qt-project.org/doc/qt-4.8/qsortfilterproxymodel.html#sorting
    But there are no examples with grid view.

    I have tried something like this:
    @ GridView {
    id: grid
    height: ..
    cellHeight: ..
    cellWidth: ..
    clip: true
    flow: GridView.TopToBottom
    snapMode: ListView.DragOverBounds
    // sortIndicatorVisible: true
    model: AbstractSortFilterProxyModel {
    source:...
    sortOrder: grid.sortIndicatorOrder
    sortRole: grid.getColumn(grid.sortIndicatorColumn).role
    }

                delegate: Item {...}
            }@
    

    Any help will be appreciated.

    Thanks

    artacademy


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.