Auf dieser Seite

QCollatorSortKey Class

Die Klasse „QCollatorSortKey“ kann verwendet werden, um die Sortierung von Zeichenketten zu beschleunigen. Mehr...

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

Hinweis: Alle Funktionen dieser Klasse sind reentrant.

Vergleiche mit QCollatorSortKey

KategorieVergleichbare Typen
schwachQCollatorSortKey

Öffentliche Funktionen

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)

Ausführliche Beschreibung

Die Klasse „QCollatorSortKey“ wird immer von „ QCollator::sortKey()“ erstellt und dient der schnellen Sortierung von Zeichenfolgen, beispielsweise beim Sortieren vieler Zeichenfolgen.

Siehe auch „ QCollator“ , „ QCollator::sortKey()“ und „ compare()“.

Dokumentation zu den Member-Funktionen

[delete] QCollatorSortKey::QCollatorSortKey()

Erstellt standardmäßig eine Instanz von ` QCollatorSortKey`. Diese Funktion wurde gelöscht.

QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)

Erstellt eine Kopie des Sortierschlüssels „ other “.

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

Erstellt mithilfe von „Move“ einen neuen QCollatorSortKey aus other.

Hinweis: Das Objekt „ other “, aus dem die Verschiebung erfolgt, befindet sich in einem teilweise initialisierten Zustand, in dem nur die Zerstörung und die Zuweisung eines neuen Werts zulässig sind.

Diese Funktion wurde in Qt 6.8 eingeführt.

[noexcept] QCollatorSortKey::~QCollatorSortKey()

Löscht den Sortierschlüssel.

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

Vergleicht diesen Schlüssel mit otherKey, der durch dieselbe sortKey()-Methode von QCollator wie dieser Schlüssel erstellt worden sein muss. Der Vergleich erfolgt gemäß der Sortierreihenfolge von QCollator.

Gibt einen negativen Wert zurück, wenn dieser Schlüssel vor otherKey sortiert wird, 0, wenn die beiden Schlüssel gleich sind, oder einen positiven Wert, wenn dieser Schlüssel nach otherKey sortiert wird.

Siehe auch operator==(), operator!=(), operator<(), operator<=(), operator>() und operator>=().

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

Tauscht diesen Sortierschlüssel gegen „ other “ aus. Dieser Vorgang ist sehr schnell und schlägt niemals fehl.

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

Weist „ other “ dieser Instanz von „ QCollatorSortKey “ zu.

Hinweis: Das verschobene Objekt other befindet sich in einem teilweise initialisierten Zustand, in dem die einzigen zulässigen Operationen die Zerstörung und die Zuweisung eines neuen Werts sind.

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

Weist diesem Sortierschlüssel den Wert „ other “ zu.

Zugehörige Nicht-Mitglieder

[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)

Beide Schlüssel müssen mit der Funktion „sortKey()“ desselben „ QCollator “ erstellt worden sein. Vergleicht „ lhs “ und „ rhs “ entsprechend dem „ QCollator “, der sie erstellt hat.

Diese Funktionen wurden in Qt 6.12 eingeführt.

Siehe auch 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.