Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QCollatorSortKey Class Reference

\inmodule QtCore More...

#include <qcollator.h>

Collaboration diagram for QCollatorSortKey:

Public Member Functions

 QCollatorSortKey ()=delete
 QCollatorSortKey (const QCollatorSortKey &other)
 Constructs a copy of the other collator key.
 QCollatorSortKey (QCollatorSortKey &&other) noexcept=default
 ~QCollatorSortKey ()
 Destroys the collator key.
QCollatorSortKeyoperator= (const QCollatorSortKey &other)
 Assigns other to this collator key.
void swap (QCollatorSortKey &other) noexcept
 \memberswap{collator key}
int compare (const QCollatorSortKey &key) const noexcept
 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< QCollatorSortKeyPrivated

Friends

class QCollatorPrivate
bool comparesEqual (const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) noexcept
Qt::weak_ordering compareThreeWay (const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) noexcept

Detailed Description

\inmodule QtCore

The QCollatorSortKey class can be used to speed up string collation. \compares equality

Since
5.2

The QCollatorSortKey class is always created by QCollator::sortKey() and is used for fast strings collation, for example when collating many strings.

\reentrant

See also
QCollator, QCollator::sortKey(), compare()

Definition at line 19 of file qcollator.h.

Constructor & Destructor Documentation

◆ QCollatorSortKey() [1/4]

QCollatorSortKey::QCollatorSortKey ( )
delete

◆ QCollatorSortKey() [2/4]

QCollatorSortKey::QCollatorSortKey ( const QCollatorSortKey & other)

Constructs a copy of the other collator key.

Definition at line 437 of file qcollator.cpp.

◆ QCollatorSortKey() [3/4]

QCollatorSortKey::QCollatorSortKey ( QCollatorSortKey && other)
defaultnoexcept
Since
6.8

Move-constructs a new QCollatorSortKey from other.

partially-formed

◆ ~QCollatorSortKey()

QCollatorSortKey::~QCollatorSortKey ( )

Destroys the collator key.

Definition at line 453 of file qcollator.cpp.

◆ QCollatorSortKey() [4/4]

QCollatorSortKey::QCollatorSortKey ( QCollatorSortKeyPrivate * d)
protected

Definition at line 429 of file qcollator.cpp.

Member Function Documentation

◆ compare()

int QCollatorSortKey::compare ( const QCollatorSortKey & otherKey) const
noexcept

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.

See also
operator<()

Definition at line 124 of file qcollator_icu.cpp.

◆ operator=()

QCollatorSortKey & QCollatorSortKey::operator= ( const QCollatorSortKey & other)

Assigns other to this collator key.

Move-assigns other to this QCollatorSortKey instance.

partially-formed

Definition at line 460 of file qcollator.cpp.

◆ swap()

void QCollatorSortKey::swap ( QCollatorSortKey & other)
inlinenoexcept

\memberswap{collator key}

Definition at line 29 of file qcollator.h.

◆ comparesEqual

bool comparesEqual ( const QCollatorSortKey & lhs,
const QCollatorSortKey & rhs )
friend

Definition at line 40 of file qcollator.h.

◆ compareThreeWay

Qt::weak_ordering compareThreeWay ( const QCollatorSortKey & lhs,
const QCollatorSortKey & rhs )
friend

Definition at line 43 of file qcollator.h.

◆ QCollatorPrivate

friend class QCollatorPrivate
friend

Definition at line 21 of file qcollator.h.

Member Data Documentation

◆ d

QExplicitlySharedDataPointer<QCollatorSortKeyPrivate> QCollatorSortKey::d
protected

Definition at line 37 of file qcollator.h.


The documentation for this class was generated from the following files: