Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
 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< 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 422 of file qcollator.cpp.

References QCollatorSortKey().

Referenced by QCollatorSortKey(), and QCollatorSortKey().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

◆ QCollatorSortKey() [3/3]

QCollatorSortKey::QCollatorSortKey ( QCollatorSortKeyPrivate * d)
protected

Definition at line 414 of file qcollator.cpp.

References QCollatorSortKey().

+ Here is the call graph for this function:

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.

References d, QCollatorSortKeyPrivate::m_key, and qstrcmp().

+ Here is the call graph for this function:

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

References d, and other().

+ Here is the call graph for this function:

◆ swap()

void QCollatorSortKey::swap ( QCollatorSortKey & other)
inlinenoexcept

Swaps this collator key with other.

Definition at line 27 of file qcollator.h.

References d, and other().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator<

bool QCollatorSortKey::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.

Referenced by compare(), and operator=().


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