StringSorter QML Type

Sorts rows based on a source model string role More...

Import Statement: import .



Detailed Description

StringSorter is a specialized RoleSorter that sorts rows based on a source model string role. StringSorter compares strings according to a localized collation algorithm.

In the following example, rows with be sorted by their lastName role :

SortFilterProxyModel {
   sourceModel: contactModel
   sorters: StringSorter { roleName: "lastName" }

Property Documentation

caseSensitivity : Qt.CaseSensitivity

This property holds the case sensitivity of the sorter.

ignorePunctation : bool

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

Note: This property is not currently supported on Apple platforms or if Qt is configured to not use ICU on Linux.

locale : Locale

This property holds the locale of the sorter.

numericMode : bool

This property holds whether the numeric mode of the sorter is enabled. This will enable proper sorting of numeric digits, so that e.g. 100 sorts after 99. By default this mode is off.