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

パブリック関数

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

詳しい説明

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

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

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

iterable を操作するiterator をラップする QConstIterator を作成します。

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++()

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

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

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

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

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

postfix++ 演算子 (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)

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

postfixの-- 演算子(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!=()も参照

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