QCollatorSortKey Class
QCollatorSortKey クラスを使用すると、文字列の照合を高速化できます。詳細...
| ヘッダー: | #include <QCollatorSortKey> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
- 継承されたメンバーを含む、すべてのメンバーの一覧
- QCollatorSortKey は、「文字列データ用クラス」および「暗黙的に共有されるクラス」の一部です。
注:このクラスのすべての関数は再入可能です。
QCollatorSortKey の比較
| カテゴリ | 比較可能な型 |
|---|---|
| weak | QCollatorSortKey |
パブリック関数
| 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) |
詳細な説明
QCollatorSortKey クラスは、常にQCollator::sortKey() によって作成され、たとえば多数の文字列を照合する場合など、高速な文字列の照合に使用されます。
QCollator 、QCollator::sortKey()、およびcompare()も参照してください 。
メンバ関数のドキュメント
[delete] QCollatorSortKey::QCollatorSortKey()
QCollatorSortKey のインスタンスをデフォルトコンストラクタで生成します。この関数は削除されました。
QCollatorSortKey::QCollatorSortKey(const QCollatorSortKey &other)
other のソーターキーのコピーを作成します。
[constexpr noexcept default, since 6.8] QCollatorSortKey::QCollatorSortKey(QCollatorSortKey &&other)
other から新しい QCollatorSortKey を move-construct します。
注:移動元のオブジェクト `other `は 、部分的に形成された状態となり、この状態では破棄と新しい値への代入のみが有効な操作となります。
この関数は Qt 6.8 で導入されました。
[noexcept] QCollatorSortKey::~QCollatorSortKey()
ソーターキーを削除します。
[noexcept] int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
このキーをotherKey と比較します。このキーは、このキーと同じQCollator のsortKey()によって作成されたものでなければなりません。比較は、そのQCollator のソート順序に従って行われます。
このキーがotherKey より前にソートされる場合は負の値を、2つのキーが等しい場合は 0 を、このキーがotherKey より後にソートされる場合は正の値を返します。
関連項目: operator==()、operator!=()、operator<()、operator<=()、operator>()、およびoperator>=()。
[noexcept] void QCollatorSortKey::swap(QCollatorSortKey &other)
このコレーターキーをother と入れ替えます。この操作は非常に高速で、失敗することはありません。
[noexcept] QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey &&other)
other をこのQCollatorSortKey インスタンスに割り当てます。
注: 移動元のオブジェクト other は 、部分的に形成された状態となり、この状態では破棄と新しい値の代入のみが有効な操作となります。
QCollatorSortKey &QCollatorSortKey::operator=(const QCollatorSortKey &other)
このコラテーターキーにother を割り当てます。
関連する非メンバー
[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)
両方のキーは、同じQCollator のsortKey()によって作成されたものでなければなりません。lhs とrhs を、それらを作成したQCollator に従って比較します。
これらの関数は Qt 6.12 で導入されました。
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.