QTextFrame::iterator Class
class QTextFrame::iterator迭代器类为读取QTextFrame 内容提供了一个迭代器 ... 更多
- 所有成员(包括继承成员)列表
- iterator 是富文本处理 API 的一部分。
公共函数
iterator() | |
bool | atEnd() const |
QTextBlock | currentBlock() const |
QTextFrame * | currentFrame() const |
QTextFrame * | parentFrame() const |
bool | operator!=(const QTextFrame::iterator &other) const |
QTextFrame::iterator & | operator++() |
QTextFrame::iterator | operator++(int) |
QTextFrame::iterator & | operator--() |
QTextFrame::iterator | operator--(int) |
bool | operator==(const QTextFrame::iterator &other) const |
详细说明
框架由QTextBlocks 和子QTextFrames 的任意序列组成。该类提供了一种遍历框架的子对象并读取其内容的方法。该类不提供修改框架内容的方法。
成员函数文档
[constexpr noexcept]
iterator::iterator()
构造一个无效迭代器。
bool iterator::atEnd() const
如果当前项目是文本框中的最后一个项目,则返回true
。
QTextBlock iterator::currentBlock() const
返回迭代器指向的当前区块。如果迭代器指向子帧,则返回的块无效。
另请参见 currentFrame()。
QTextFrame *iterator::currentFrame() const
返回迭代器指向的当前帧,如果迭代器当前指向一个块,则返回nullptr
。
另请参见 currentBlock()。
QTextFrame *iterator::parentFrame() const
返回当前帧的父帧。
另请参阅 currentFrame() 和QTextFrame::parentFrame()。
bool iterator::operator!=(const QTextFrame::iterator &other) const
如果迭代器与other 迭代器不同,则返回 true;否则返回false
。
QTextFrame::iterator &iterator::operator++()
将迭代器移动到下一帧或块。
另请参阅 currentBlock() 和currentFrame() 。
QTextFrame::iterator iterator::operator++(int)
后缀++
运算符 (i++
) 将迭代器前进到文本框中的下一个项目,并返回一个指向旧项目的迭代器。
QTextFrame::iterator &iterator::operator--()
将迭代器移动到上一帧或块。
另请参阅 currentBlock() 和currentFrame() 。
QTextFrame::iterator iterator::operator--(int)
后缀--
运算符 (i--
) 使前一项位于当前帧中,并返回一个指向旧项的迭代器。
bool iterator::operator==(const QTextFrame::iterator &other) const
如果迭代器与other 的迭代器相同,则返回 true;否则返回false
。
© 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.