本页内容

QProtobufRepeatedIterator Class

支持遍历重复的 Protobuf 类型。更多内容...

标题: #include <QProtobufRepeatedIterator>
CMake: find_package(Qt6 REQUIRED COMPONENTS Protobuf)
target_link_libraries(mytarget PRIVATE Qt6::Protobuf)
自: Qt 6.8

公共函数

QProtobufRepeatedIterator()
QProtobufRepeatedIterator(QProtobufRepeatedIterator &&other)
~QProtobufRepeatedIterator()
QProtobufMessage *addNext()
bool hasNext() const
bool isValid() const
QProtobufMessage *next()
void push()
QProtobufRepeatedIterator &operator=(QProtobufRepeatedIterator &&other)

详细说明

允许遍历重复的 Protobuf 类型,并将重复的字段元素作为对 `QProtobufMessage` 的引用进行访问。

成员函数文档

[constexpr noexcept default] QProtobufRepeatedIterator::QProtobufRepeatedIterator()

默认创建一个QProtobufRepeatedIterator 实例。

[noexcept] QProtobufRepeatedIterator::QProtobufRepeatedIterator(QProtobufRepeatedIterator &&other)

从other 创建一个新的QProtobufRepeatedIterator。

[noexcept] QProtobufRepeatedIterator::~QProtobufRepeatedIterator()

销毁迭代器。

QProtobufMessage *QProtobufRepeatedIterator::addNext()

返回重复字段中的一个新的临时元素。

[noexcept] bool QProtobufRepeatedIterator::hasNext() const

如果迭代器能够从重复字段中读取下一个元素,则返回true 。

[noexcept] bool QProtobufRepeatedIterator::isValid() const

如果迭代器指向一个有效的数据对象,则返回true 。

QProtobufMessage *QProtobufRepeatedIterator::next()

返回重复字段中的下一个子元素。

void QProtobufRepeatedIterator::push()

将由addNext 函数创建的元素添加到重复字段中。

[noexcept] QProtobufRepeatedIterator &QProtobufRepeatedIterator::operator=(QProtobufRepeatedIterator &&other)

将other 赋值给此QProtobufRepeatedIterator ,并返回对更新后对象的引用。

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