The QCollatorSortKey class can be used to speed up string collation. 更多...
| 头: |
#include <QCollatorSortKey>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
|
| qmake: |
QT += core
|
注意: 此类的所有函数 可重入 .
| QCollatorSortKey (const QCollatorSortKey & other ) | |
(从 6.8 起)
|
QCollatorSortKey (QCollatorSortKey && other ) |
| ~QCollatorSortKey () | |
| int | compare (const QCollatorSortKey & otherKey ) const |
| void | swap (QCollatorSortKey & other ) |
| QCollatorSortKey & | operator= (QCollatorSortKey && other ) |
| QCollatorSortKey & | operator= (const QCollatorSortKey & other ) |
| bool | operator< (const QCollatorSortKey & lhs , const QCollatorSortKey & rhs ) |
The QCollatorSortKey class is always created by QCollator::sortKey () and is used for fast strings collation, for example when collating many strings.
另请参阅 QCollator , QCollator::sortKey (),和 compare ().
构造副本为 other collator key.
[noexcept, since 6.8]
QCollatorSortKey::
QCollatorSortKey
(
QCollatorSortKey
&&
other
)
Move-constructs a new QCollatorSortKey from other .
注意: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.
该函数在 Qt 6.8 引入。
[noexcept]
QCollatorSortKey::
~QCollatorSortKey
()
Destroys the collator key.
Compares this key to otherKey , which must have been created by the same QCollator 's sortKey() as this key. The comparison is performed in accordance with that QCollator 's sort order.
Returns a negative value if this key sorts before otherKey , 0 if the two keys are equal or a positive value if this key sorts after otherKey .
另请参阅 operator< ().
[noexcept]
void
QCollatorSortKey::
swap
(
QCollatorSortKey
&
other
)
Swaps this collator key with other 。此操作非常快且从不失败。
[noexcept]
QCollatorSortKey
&QCollatorSortKey::
operator=
(
QCollatorSortKey
&&
other
)
移动赋值 other 到此 QCollatorSortKey 实例。
注意: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.
赋值 other to this collator key.
Both keys must have been created by the same
QCollator
's sortKey(). Returns
true
if
lhs
should be sorted before
rhs
, according to the
QCollator
that created them; otherwise returns
false
.
另请参阅 QCollatorSortKey::compare ().