RoleSorter QML Type

Sort data in a SortFilterProxyModel based on configured role name. 更多...

import 语句: import QtQml.Models
Since: Qt 6.10
继承:

Sorter

状态: 预备

This type is under development and is subject to change.

特性

详细描述

RoleSorter allows the user to sort the data according to the role name as configured in the source model.

The RoleSorter can be configured in the sort filter proxy model as below,

SortFilterProxyModel {
    model: sourceModel
    sorters: [
        RoleSorter { roleName: "firstname" }
    ]
}
					

特性文档编制

roleName : string

This property holds the role name that will be used to sort the data.

The default value is display role.