QCollatorSortKey Class
La classe QCollatorSortKey permet d'accélérer le tri des chaînes de caractères. En savoir plus...
| En-tête : | #include <QCollatorSortKey> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake : | QT += core |
- Liste de tous les membres, y compris les membres hérités
- QCollatorSortKey fait partie des classes pour les données de type chaîne et des classes implicitement partagées.
Remarque : toutes les fonctions de cette classe sont réentrantes.
Comparaisons QCollatorSortKey
| Catégorie | Types comparables |
|---|---|
| faible | QCollatorSortKey |
Fonctions publiques
| 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) |
Éléments non membres associés
(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) |
Description détaillée
La classe QCollatorSortKey est toujours créée par la fonction QCollator::sortKey() et sert à effectuer un classement rapide des chaînes de caractères, par exemple lors du classement d'un grand nombre de chaînes.
Voir également QCollator, QCollator::sortKey() et compare().
Documentation des fonctions membres
[delete] QCollatorSortKey::QCollatorSortKey()
Construit par défaut une instance de ` QCollatorSortKey`. Cette fonction est supprimée.
QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)
Crée une copie de la clé de tri « other ».
[constexpr noexcept default, since 6.8] QCollatorSortKey::QCollatorSortKey(QCollatorSortKey &&other)
La fonction `move` construit un nouvel objet `QCollatorSortKey` à partir de ` other`.
Remarque : l'objet d'origine other est placé dans un état partiellement formé, dans lequel les seules opérations valides sont la destruction et l'affectation d'une nouvelle valeur.
Cette fonction a été introduite dans Qt 6.8.
[noexcept] QCollatorSortKey::~QCollatorSortKey()
Supprime la clé de tri.
[noexcept] int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
Compare cette clé à otherKey, qui doit avoir été créée par la même méthode sortKey() de QCollator que cette clé. La comparaison est effectuée conformément à l'ordre de tri défini sur QCollator.
Renvoie une valeur négative si cette clé est classée avant otherKey, 0 si les deux clés sont égales, ou une valeur positive si cette clé est classée après otherKey.
Voir également operator==(), operator!=(), operator<(), operator<=(), operator>() et operator>=().
[noexcept] void QCollatorSortKey::swap(QCollatorSortKey &other)
Permute cette clé de tri avec other. Cette opération est très rapide et ne rencontre jamais d'échec.
[noexcept] QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey &&other)
Cette opération attribue other à cette instance de QCollatorSortKey.
Remarque : l’objet d’origine other est placé dans un état partiellement formé, dans lequel les seules opérations valides sont la destruction et l’affectation d’une nouvelle valeur.
QCollatorSortKey &QCollatorSortKey::operator=(const QCollatorSortKey &other)
Attribue la valeur « other » à cette clé de tri.
Non-membres concernés
[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)
Les deux clés doivent avoir été créées par la même méthode sortKey() de QCollator. Compare lhs et rhs en fonction de l'QCollator qui les a créées.
Ces fonctions ont été introduites dans Qt 6.12.
Voir également 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.