The QTextBlock::iterator 类提供迭代器用于读取内容在 QTextBlock . 更多...
头: | #include <iterator> |
qmake: | QT += gui |
iterator () | |
iterator (const iterator & other ) | |
bool | atEnd () const |
QTextFragment | fragment () const |
bool | operator!= (const iterator & other ) const |
iterator & | operator++ () |
iterator | operator++ ( int ) |
iterator & | operator-- () |
iterator | operator-- ( int ) |
bool | operator== (const iterator & other ) const |
The QTextBlock::iterator 类提供迭代器用于读取内容在 QTextBlock .
A block consists of a sequence of text fragments. This class provides a way to iterate over these, and read their contents. It does not provide a way to modify the internal structure or contents of the block.
An iterator can be constructed and used to access the fragments within a text block in the following way:
QTextBlock::iterator it; for (it = currentBlock.begin(); !(it.atEnd()); ++it) { QTextFragment currentFragment = it.fragment(); if (currentFragment.isValid()) processFragment(currentFragment); }
另请参阅 QTextFragment .
为此文本块构造迭代器。
Copy constructor. Constructs a copy of the other iterator.
返回
true
若当前项是文本块的最后项。
返回迭代器目前指向的文本片段。
Retuns true if this iterator is different from the
other
iterator; otherwise returns
false
.
The prefix ++ operator (
++i
) advances the iterator to the next item in the hash and returns an iterator to the new current item.
The postfix ++ operator (
i++
) advances the iterator to the next item in the text block and returns an iterator to the old current item.
The prefix -- operator (
--i
) makes the preceding item current and returns an iterator pointing to the new current item.
The postfix -- operator (
i--
) makes the preceding item current and returns an iterator to the old current item.
Retuns true if this iterator is the same as the
other
iterator; otherwise returns
false
.