在本页

QMetaAssociation::Iterable::Iterator Class

class QMetaAssociation::Iterable::Iterator

QMetaAssociation::Iterable::Iterator 允许迭代QVariant 中的容器 ...更多...

该类在 Qt 6.11 中引入。

公共函数

QVariant key() const
QVariant value() const
int operator*() const
int operator->() const

详细说明

QMetaAssociation::Iterable::Iterator 只能由QMetaAssociation::Iterable 实例创建,其使用方式与其他 stl 风格迭代器类似。

另请参阅 QMetaAssociation::Iterable

成员函数文档

QVariant Iterator::key() const

返回该迭代器指向的键值。

QVariant Iterator::value() const

返回该迭代器指向的映射值。如果容器没有提供映射值(例如集合),则返回无效的QVariant::Reference

int Iterator::operator*() const

返回当前项目,并转换为QVariant::Reference 。如果有映射值,则生成的QVariant::Reference 将解析为映射值;如果没有映射值,则解析为键值。

int Iterator::operator->() const

返回当前项目,并转换为QVariant::Pointer 。如果有映射值,则生成的QVariant::Pointer 将解析为映射值;如果没有映射值,则解析为键值。

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