![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qcollator.h>
Public Member Functions | |
QCollatorSortKey (const QCollatorSortKey &other) | |
Constructs a copy of the other collator key. | |
~QCollatorSortKey () | |
Destroys the collator key. | |
QCollatorSortKey & | operator= (const QCollatorSortKey &other) |
Assigns other to this collator key. | |
void | swap (QCollatorSortKey &other) noexcept |
Swaps this collator key with other. | |
int | compare (const QCollatorSortKey &key) const |
Compares this key to otherKey, which must have been created by the same QCollator's sortKey() as this key. | |
Protected Member Functions | |
QCollatorSortKey (QCollatorSortKeyPrivate *) | |
Protected Attributes | |
QExplicitlySharedDataPointer< QCollatorSortKeyPrivate > | d |
Friends | |
class | QCollator |
bool | operator< (const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) |
Both keys must have been created by the same QCollator's sortKey(). | |
\inmodule QtCore
The QCollatorSortKey class can be used to speed up string collation.
The QCollatorSortKey class is always created by QCollator::sortKey() and is used for fast strings collation, for example when collating many strings.
\reentrant
Definition at line 17 of file qcollator.h.
QCollatorSortKey::QCollatorSortKey | ( | const QCollatorSortKey & | other | ) |
Constructs a copy of the other collator key.
Definition at line 404 of file qcollator.cpp.
References QCollatorSortKey().
Referenced by QCollatorSortKey(), and QCollatorSortKey().
QCollatorSortKey::~QCollatorSortKey | ( | ) |
Destroys the collator key.
Definition at line 412 of file qcollator.cpp.
|
protected |
Definition at line 396 of file qcollator.cpp.
References QCollatorSortKey().
int QCollatorSortKey::compare | ( | const QCollatorSortKey & | otherKey | ) | const |
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.
Definition at line 117 of file qcollator_icu.cpp.
References d, QCollatorSortKeyPrivate::m_key, and qstrcmp().
QCollatorSortKey & QCollatorSortKey::operator= | ( | const QCollatorSortKey & | other | ) |
Assigns other to this collator key.
Move-assigns other to this collator key.
Definition at line 419 of file qcollator.cpp.
|
inlinenoexcept |
Swaps this collator key with other.
Definition at line 25 of file qcollator.h.
|
friend |
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
.
Definition at line 29 of file qcollator.h.
|
friend |
Definition at line 19 of file qcollator.h.
|
protected |
Definition at line 35 of file qcollator.h.
Referenced by compare(), and operator=().