Qt 6.x
The Qt SDK
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 ()
 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 17 of file qcollator.h.

Constructor & Destructor Documentation

◆ QCollatorSortKey() [1/2]

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().

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

◆ ~QCollatorSortKey()

QCollatorSortKey::~QCollatorSortKey ( )

Destroys the collator key.

Definition at line 412 of file qcollator.cpp.

◆ QCollatorSortKey() [2/2]

QCollatorSortKey::QCollatorSortKey ( QCollatorSortKeyPrivate d)
protected

Definition at line 396 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 collator key.

Definition at line 419 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 25 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 29 of file qcollator.h.

◆ QCollator

friend class QCollator
friend

Definition at line 19 of file qcollator.h.

Member Data Documentation

◆ d

QExplicitlySharedDataPointer<QCollatorSortKeyPrivate> QCollatorSortKey::d
protected

Definition at line 35 of file qcollator.h.

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


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