QCollatorSortKey 类
QCollatorSortKey 类可用于加速字符串排序。更多信息...
| 头文件 | #include <QCollatorSortKey> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) | 
| qmake | QT += core | 
- 所有成员列表,包括继承成员
- QCollatorSortKey 是字符串数据处理类的一部分,以及隐式共享类之一。查看字符串数据处理类 和 查看隐式共享类.
注意: 此类中所有函数都是可重入的。
公共函数
| QCollatorSortKey(const QCollatorSortKey &other) | |
| ~QCollatorSortKey() | |
| int | compare(const QCollatorSortKey &otherKey) const | 
| void | swap(QCollatorSortKey &other) | 
| QCollatorSortKey & | operator=(const QCollatorSortKey &other) | 
| QCollatorSortKey & | operator=(QCollatorSortKey &&other) | 
相关非成员
| bool | operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) | 
详细描述
QCollatorSortKey 类始终通过 QCollator::sortKey() 创建,并用于快速字符串排序,例如排序大量字符串时。
请参阅:QCollator,QCollator::sortKey() 和 compare。
成员函数文档
QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)
构造 other 排序键的一个副本。
[noexcept] QCollatorSortKey::~QCollatorSortKey()
销毁排序键。
int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
将此键与其他键进行比较,其他键必须是由同一 QCollator's sortKey() 创建的。比较会遵循该 QCollator 的排序顺序。
如果此键在其他键之前排序,返回负值;如果两个键相等,返回 0;如果此键在其他键之后排序,返回正值。
请参阅:operator<。
[noexcept] void QCollatorSortKey::swap(QCollatorSortKey &其他)
交换此排序键与其他。
QCollatorSortKey &QCollatorSortKey::operator=(const QCollatorSortKey &其他)
将其他分配给此排序键。
[noexcept] QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey &&其他)
移动分配其他到此排序键。
相关非成员
bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
两个键必须由同一QCollator的sortKey()创建。如果根据创建它们的QCollator,应该先对lhs进行排序,则返回true;否则返回false。
© 2024 The Qt Company Ltd. 本文档中包含的贡献的文档版权属于其各自的所有者。本提供的文档是根据自由软件基金会发布的GNU自由文档许可协议版本1.3许可的。Qt以及相应的标志是芬兰的Qt公司全球以及在世界其他国家/地区的商标。所有其他商标属于它们各自的所有者。