QCollatorSortKey Class
The QCollatorSortKey class can be used to speed up string collation. More…
| Header | #include <QCollatorSortKey> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Since | 5.2 |
List of all members, including inherited members
Public Functions
| QCollatorSortKey(const QCollatorSortKey &other) | |
| QCollatorSortKey(QCollatorSortKey &&other) | |
| ~QCollatorSortKey() | |
| QCollatorSortKey & | operator=(const QCollatorSortKey &other) |
| QCollatorSortKey & | operator=(QCollatorSortKey &&other) |
| void | swap(QCollatorSortKey &other) |
| int | compare(const QCollatorSortKey &otherKey) const |
Detailed Description
A sort key is obtained from QCollator::sortKey(). Comparing two keys with compare() gives the same result as comparing their strings with the collator, but is faster when each string is compared many times, as when sorting.
See also QCollator.
Differences from Qt
The key is an Nt-specific byte sequence; keys from different collator settings must not be compared.
Member Function Documentation
QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)
Constructs a copy of other.
QCollatorSortKey::QCollatorSortKey(QCollatorSortKey &&other)
Move-constructs a key from other.
QCollatorSortKey::~QCollatorSortKey()
Destroys the key.
int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
Returns a negative number, zero or a positive number if this key sorts before, equal to or after otherKey.
QCollatorSortKey & QCollatorSortKey::operator=(const QCollatorSortKey &other)
Assigns other to this key and returns a reference to it.
QCollatorSortKey & QCollatorSortKey::operator=(QCollatorSortKey &&other)
Move-assigns other to this key and returns a reference to it.
void QCollatorSortKey::swap(QCollatorSortKey &other)
Swaps this key with other.