QAssociativeIterable Class
QAssociativeIterable クラスは、QVariant 内の連想コンテナ向けの反復可能インターフェースです。詳細...
| ヘッダー: | #include <QAssociativeIterable> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 継承元: | QIterable |
| ステータス: | バージョン6.15まで |
このクラスはバージョン 6.15 で非推奨となる予定です。
パブリック型
| BidirectionalConstIterator | |
| BidirectionalIterator | |
| ForwardConstIterator | |
| ForwardIterator | |
| InputConstIterator | |
| InputIterator | |
| RandomAccessConstIterator | |
| RandomAccessIterator | |
(until 6.15) | const_iterator |
(since 6.0, until 6.15) | iterator |
パブリック関数
| bool | containsKey(const QVariant &key) |
| QAssociativeIterable::const_iterator | find(const QVariant &key) const |
| void | insertKey(const QVariant &key) |
| QAssociativeIterable::iterator | mutableFind(const QVariant &key) |
| void | removeKey(const QVariant &key) |
| void | setValue(const QVariant &key, const QVariant &mapped) |
| QVariant | value(const QVariant &key) const |
詳細な説明
代わりに `QMetaAssociation::Iterable ` を使用してください。
このクラスを使用すると、QVariant 内に保持されている連想コンテナの要素に、いくつかの方法でアクセスすることができます。QVariant からQAssociativeIterableのインスタンスを抽出できるのは、その がQVariantHash またはQVariantMap に変換できる場合、あるいはカスタム可変ビューが登録されている場合です。
コンテナ自体を反復処理する前に、そのコピーが作成されることはありません。
QVariantも参照してください 。
メンバ型のドキュメント
[alias] QAssociativeIterable::BidirectionalConstIterator
std::bidirectional_iterator_tag を使用して、const_iterator を公開します。
[alias] QAssociativeIterable::BidirectionalIterator
std::bidirectional_iterator_tag を使用してイテレータを公開します。
[alias] QAssociativeIterable::ForwardConstIterator
std::forward_iterator_tag を使用して、const_iterator を公開します。
[alias] QAssociativeIterable::ForwardIterator
std::forward_iterator_tag を使用してイテレータを公開します。
[alias] QAssociativeIterable::InputConstIterator
std::input_iterator_tag を使用して、const_iterator を公開します。
[alias] QAssociativeIterable::InputIterator
std::input_iterator_tag を使用してイテレータを公開します。
[alias] QAssociativeIterable::RandomAccessConstIterator
std::random_access_iterator_tag を使用して、const_iterator を公開します。
[alias] QAssociativeIterable::RandomAccessIterator
std::random_access_iterator_tag を使用してイテレータを公開します。
[alias, until 6.15] QAssociativeIterable::const_iterator
このtypedefは、バージョン6.15で非推奨となる予定です。
代わりに `QMetaAssociation::Iterable::ConstIterator ` を使用してください。
QAssociativeIterable::const_iterator を使用すると、QVariant 内のコンテナを反復処理できます。
QAssociativeIterable::const_iterator は、QAssociativeIterable インスタンスによってのみ作成可能であり、他の STL スタイルのイテレータと同様の方法で使用できます。
QAssociativeIterableも参照してください 。
[alias, since 6.0, until 6.15] QAssociativeIterable::iterator
この typedef は、バージョン 6.15 で非推奨となる予定です。
代わりに `QMetaAssociation::Iterable::Iterator ` を使用してください。
QAssociativeIterable::iterator を使用すると、QVariant 内のコンテナを反復処理することができます。
QAssociativeIterable::iterator は、QAssociativeIterable のインスタンスによってのみ作成可能であり、他の STL スタイルのイテレータと同様の方法で使用できます。
このtypedefはQt 6.0で導入されました。
QAssociativeIterableも参照してください 。
メンバ関数のドキュメント
bool QAssociativeIterable::containsKey(const QVariant &key)
コンテナに指定されたkey を持つエントリが存在する場合、true を返し、そうでない場合はfalse を返します。key が期待される型に変換できない場合、false が返されます。
QAssociativeIterable::const_iterator QAssociativeIterable::find(const QVariant &key) const
指定されたkey にある要素、またはそのキーが存在しない場合はコンテナの末尾を指すconst_iterator を取得します。key が期待される型に変換できない場合は、コンテナの末尾が返されます。
void QAssociativeIterable::insertKey(const QVariant &key)
指定されたkey を持つ新しいエントリを挿入するか、指定されたkey を持つ既存のエントリのマップ値を、デフォルトで生成されたマップ値にリセットします。key は期待される型に型変換されます。変換できない場合は、デフォルト値が挿入されます。
QAssociativeIterable::iterator QAssociativeIterable::mutableFind(const QVariant &key)
指定されたkey の位置にある要素、またはそのキーが存在しない場合はコンテナの末尾を指すイテレータを取得します。key が期待される型に変換できない場合、コンテナの末尾が返されます。
void QAssociativeIterable::removeKey(const QVariant &key)
指定されたkey を持つエントリをコンテナから削除します。key は期待される型に変換されます。変換できない場合は、デフォルト値が削除されます。
void QAssociativeIterable::setValue(const QVariant &key, const QVariant &mapped)
key に関連付けられたマップされた値を、可能であればmapped に設定します。指定されたkey に対してまだエントリが存在しない場合は、新しいエントリを挿入します。key がキーの型に変換できない場合、デフォルト構築されたキーの型の値が上書きされます。
value()も参照してください 。
QVariant QAssociativeIterable::value(const QVariant &key) const
指定されたkey に対応するマップされた値を取得します。キーが存在しない場合は、マップされた型のデフォルトコンストラクタで生成されたQVariant を返します。key がキーの型に変換できない場合、デフォルトコンストラクタで生成されたキーに関連付けられたマップされた値が返されます。
setValue()も参照してください 。
© 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.