StringSorter QML Type

Sort data in a SortFilterProxyModel based on ordering of the locale. 更多...

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

Sorter

状态: 预备

This type is under development and is subject to change.

特性

详细描述

StringSorter allows the user to sort the data according to the role name as configured in the source model. StringSorter compares strings according to a localized collation algorithm.

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

SortFilterProxyModel {
    model: sourceModel
    sorters: [
        StringSorter { roleName: "name" }
    ]
}
					

特性文档编制

caseSensitivity : Qt::CaseSensitivity

This property holds the case sensitivity of the sorter.

默认值为 Qt::CaseSensitive .

ignorePunctuation : bool

This property holds whether the sorter ignores punctation. If ignorePunctuation is true , punctuation characters and symbols are ignored when determining sort order.

默认值为 false .

locale : Locale

This property holds the locale of the sorter.

默认值为 QLocale::system ()

numericMode : bool

This property holds whether the numeric mode of the sorter is enabled.

默认值为 false .