StringSorter QML Type
根据位置排序对SortFilterProxyModel 中的数据进行排序。更多
Import Statement: | import QtQml.Models |
Since: | Qt 6.10 |
Inherits: | |
Status: | Preliminary |
此类型正在开发中,可能会有更改。
属性
- caseSensitivity : Qt::CaseSensitivity
- ignorePunctuation : bool
- locale : Locale
- numericMode : bool
详细说明
StringSorter 允许用户根据源模型中配置的角色名称对数据进行排序。StringSorter 根据本地化的整理算法对字符串进行比较。
StringSorter 可在排序过滤器代理模型中配置,如下所示、
SortFilterProxyModel { model: sourceModel sorters: [ StringSorter { roleName: "name" } ] }
属性文档
caseSensitivity : Qt::CaseSensitivity |
该属性表示排序器的大小写敏感性。
默认值为Qt::CaseSensitive 。
ignorePunctuation : bool |
该属性表示排序器是否忽略标点符号。如果ignorePunctuation
为true
,则在确定排序顺序时会忽略标点符号和符号。
默认值为false
。
locale : Locale |
该属性表示排序器的地域。
默认值为QLocale::system()
numericMode : bool |
该属性用于保存是否启用了排序器的数字模式。
默认值为false
。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.