このページでは

QMetaSequence::Iterable::ConstIterator Class

class QMetaSequence::Iterable::ConstIterator

QMetaSequence::Iterable::ConstIterator は、QVariant のコンテナに対する反復を可能にする

このクラスは Qt 6.11 で導入されました。

パブリック関数

QVariant operator*() const
int operator->() const
QVariant operator[](qsizetype n) const

詳細説明

QMetaSequence::Iterable::ConstIterator は、QMetaSequence::Iterable インスタンスによってのみ作成することができ、他の stl スタイルのイテレータと同様の方法で使用することができます。

QList<int>intList= {7, 11, 42}QVariantvariant=QVariant::fromValue(intList);if(variant.canConvert<QVariantList>()) { QMetaSequence::Iterable iterable=variant.value<QMetaSequence::Iterable>();// C++11 の range-for が使える: for(constQVariant&v: iterable) { の場合        qDebug() << v;
    }// イテレータを使用できるQMetaSequence::Iterable::const_iterator it=iterable.begin();constQMetaSequence::Iterable::const_iterator end=iterable.end();for( ; it!=end;++it) { } // イテレータが使える。        qDebug() << *it;
    } }

メンバ関数ドキュメント

QVariant ConstIterator::operator*() const

現在の項目をQVariant に変換して返します。

int ConstIterator::operator->() const

現在の項目をQVariant::ConstPointer に変換して返します。

QVariant ConstIterator::operator[](qsizetype n) const

現在の項目からn だけオフセットされた項目を、QVariant に変換して返します。

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