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 (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
 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 QCollator
 
bool operator< (const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
 Both keys must have been created by the same QCollator's sortKey().
 

Detailed Description

\inmodule QtCore

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

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 18 of file qcollator.h.

Constructor & Destructor Documentation

◆ QCollatorSortKey() [1/3]

QCollatorSortKey::QCollatorSortKey ( const QCollatorSortKey & other)

Constructs a copy of the other collator key.

Definition at line 420 of file qcollator.cpp.

◆ QCollatorSortKey() [2/3]

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 436 of file qcollator.cpp.

◆ QCollatorSortKey() [3/3]

QCollatorSortKey::QCollatorSortKey ( QCollatorSortKeyPrivate * d)
protected

Definition at line 412 of file qcollator.cpp.

Member Function Documentation

◆ compare()

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.

See also
operator<()

Definition at line 117 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 443 of file qcollator.cpp.

◆ swap()

void QCollatorSortKey::swap ( QCollatorSortKey & other)
inlinenoexcept

\memberswap{collator key}

Definition at line 27 of file qcollator.h.

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const QCollatorSortKey & lhs,
const QCollatorSortKey & rhs )
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.

See also
QCollatorSortKey::compare()

Definition at line 31 of file qcollator.h.

◆ QCollator

friend class QCollator
friend

Definition at line 20 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: