In questa pagina

QCollatorSortKey Class

La classe QCollatorSortKey può essere utilizzata per velocizzare l'ordinamento delle stringhe. Per saperne di più...

Intestazione: #include <QCollatorSortKey>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

Nota: tutte le funzioni di questa classe sono rientranti.

Confronto con QCollatorSortKey

CategoriaTipi comparabili
weakQCollatorSortKey

Funzioni pubbliche

QCollatorSortKey()
QCollatorSortKey(const QCollatorSortKey &other)
(since 6.8) QCollatorSortKey(QCollatorSortKey &&other)
~QCollatorSortKey()
int compare(const QCollatorSortKey &otherKey) const
void swap(QCollatorSortKey &other)
QCollatorSortKey &operator=(QCollatorSortKey &&other)
QCollatorSortKey &operator=(const QCollatorSortKey &other)
(since 6.12) bool operator!=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator<=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator==(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator>(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
(since 6.12) bool operator>=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

Descrizione dettagliata

La classe QCollatorSortKey viene sempre creata da QCollator::sortKey() e viene utilizzata per un ordinamento veloce delle stringhe, ad esempio quando si ordinano molte stringhe.

Vedi anche QCollator, QCollator::sortKey() e compare().

Documentazione delle funzioni membro

[delete] QCollatorSortKey::QCollatorSortKey()

Crea un'istanza di ` QCollatorSortKey` con i valori predefiniti. Questa funzione è stata eliminata.

QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)

Crea una copia della chiave del collatore “ other ”.

[constexpr noexcept default, since 6.8] QCollatorSortKey::QCollatorSortKey(QCollatorSortKey &&other)

Crea un nuovo oggetto `QCollatorSortKey` a partire da ` other`.

Nota: l'oggetto da cui è stato effettuato lo spostamento, other, viene posto in uno stato parzialmente formato, in cui le uniche operazioni valide sono la distruzione e l'assegnazione di un nuovo valore.

Questa funzione è stata introdotta in Qt 6.8.

[noexcept] QCollatorSortKey::~QCollatorSortKey()

Elimina la chiave del collator.

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

Confronta questa chiave con otherKey, che deve essere stata creata dalla funzione sortKey() dello stesso QCollator, proprio come questa chiave. Il confronto viene effettuato in base all'ordine di ordinamento specificato su QCollator.

Restituisce un valore negativo se questa chiave viene ordinata prima di otherKey, 0 se le due chiavi sono uguali, oppure un valore positivo se questa chiave viene ordinata dopo otherKey.

Vedi anche operator==(), operator!=(), operator<(), operator<=(), operator>() e operator>=().

[noexcept] void QCollatorSortKey::swap(QCollatorSortKey &other)

Scambia questa chiave di ordinamento con other. Questa operazione è molto veloce e non fallisce mai.

[noexcept] QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey &&other)

L'operazione "Move-assigns" assegna other a questa istanza di QCollatorSortKey.

Nota: l'oggetto da cui è stato effettuato lo spostamento, other, viene posto in uno stato parzialmente formato, in cui le uniche operazioni valide sono la distruzione e l'assegnazione di un nuovo valore.

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

Assegna " other " a questa chiave di ordinamento.

Non membri correlati

[noexcept, since 6.12] bool operator!=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator<=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator==(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator>(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

[noexcept, since 6.12] bool operator>=(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)

Entrambe le chiavi devono essere state create dalla stessa funzione `sortKey()` di QCollator. Confronta lhs e rhs in base al QCollator che le ha create.

Queste funzioni sono state introdotte in Qt 6.12.

Vedi anche QCollatorSortKey::compare().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.