このページでは

QConstIterator Struct

template <typename Container> struct QConstIterator

QConstIterator を使用すると、QVariant 内のコンテナを反復処理することができます。詳細...

ヘッダー: #include <QConstIterator>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
以下のように: Qt 6.0
継承元: QBaseIterator
継承元:

QMetaAssociation::Iterable::ConstIterator およびQMetaSequence::Iterable::ConstIterator

パブリック関数

QConstIterator(const QIterable<Container> *iterable, void *iterator)
bool operator!=(const QConstIterator<Container> &other) const
QConstIterator<Container> operator+(qsizetype j) const
QConstIterator<Container> &operator++()
QConstIterator<Container> operator++(int)
QConstIterator<Container> &operator+=(qsizetype j)
QConstIterator<Container> operator-(qsizetype j) const
qsizetype operator-(const QConstIterator<Container> &j) const
QConstIterator<Container> &operator--()
QConstIterator<Container> operator--(int)
QConstIterator<Container> &operator-=(qsizetype j)
bool operator==(const QConstIterator<Container> &other) const

詳細な説明

QConstIterator<Container> は、コンテナに対する const 反復処理を提供します。ここで、Container は、コンテナの反復処理機能を定義するメタ型記述子(QMetaSequence またはQMetaAssociation のいずれか)です。

QIterator およびQIterableも参照してください 。

メンバ関数のドキュメント

[explicit] QConstIterator::QConstIterator(const QIterable<Container> *iterable, void *iterator)

iterator をラップする QConstIterator を作成し、iterable に対して操作を行います。

bool QConstIterator::operator!=(const QConstIterator<Container> &other) const

other がこのイテレータとは異なる項目を指している場合はtrue を返し、そうでない場合はfalse を返します。

operator==()も参照してください 。

QConstIterator<Container> QConstIterator::operator+(qsizetype j) const

このイテレータからj の位置先にある項目へのイテレータを返します。

operator-() およびoperator+=()も参照してください 。

QConstIterator<Container> &QConstIterator::operator++()

++ 演算子(++it )は、イテレータをコンテナ内の次の要素へと進め、新しい現在の要素へのイテレータを返します。

QIterable<Container>::end() に対してこの関数を呼び出すと、未定義の結果となります。

operator--()も参照してください 。

QConstIterator<Container> QConstIterator::operator++(int)

後置演算子 `++ ` (it++) は、イテレータをコンテナ内の次の要素に進め、直前に現在位置にあった要素へのイテレータを返します。

これはオーバーロードされた関数です。

QConstIterator<Container> &QConstIterator::operator+=(qsizetype j)

イテレータをj 個分進めます。

operator-=() およびoperator+()も参照してください 。

QConstIterator<Container> QConstIterator::operator-(qsizetype j) const

このイテレータからj の位置だけ後ろにある項目へのイテレータを返します。

QVariant に指定されたコンテナが双方向イテレーションをサポートしていない場合、この関数を呼び出すと未定義の結果となります。

operator+()、operator-=)、およびQIterable::canReverseIterate()も参照してください 。

qsizetype QConstIterator::operator-(const QConstIterator<Container> &j) const

2つのイテレータ間の距離を返します。

これはオーバーロードされた関数です。

operator+()、operator-=()、およびQIterable::canReverseIterate()も参照してください 。

QConstIterator<Container> &QConstIterator::operator--()

接頭辞演算子 `-- ` (--it) は、直前の要素を現在の要素とし、新しい現在の要素へのイテレータを返します。

QIterable<Container>::begin() に対してこの関数を呼び出すと、未定義の結果となります。

QVariant 内のコンテナが双方向反復をサポートしていない場合、この関数を呼び出すと、結果は未定義となります。

operator++() およびQIterable::canReverseIterate()も参照してください 。

QConstIterator<Container> QConstIterator::operator--(int)

ポストフィックス演算子-- (it-- )は、直前の要素を現在の要素とし、その直前の要素へのイテレータを返します。

QVariant で指定されたコンテナが双方向の反復処理をサポートしていない場合、この関数を呼び出すと未定義の結果となります。

これはオーバーロードされた関数です。

QIterable::canReverseIterate()も参照してください 。

QConstIterator<Container> &QConstIterator::operator-=(qsizetype j)

イテレータをj 個分戻します。

QVariant 内のコンテナが双方向反復に対応していない場合、この関数を呼び出すと未定義の結果となります。

operator+=()、operator-()、およびQIterable::canReverseIterate()も参照してください 。

bool QConstIterator::operator==(const QConstIterator<Container> &other) const

other がこのイテレータと同じ項目を指している場合は `true ` を返し、そうでない場合は `false` を返します。

operator!=()も参照してください 。

© 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.