iterator 類

class QTextFrame ::iterator

iterator 類提供迭代器用於讀取內容從 QTextFrame . 更多...

公共函數

iterator (const iterator & other )
iterator ()
iterator & operator= (const iterator & other )
bool atEnd () const
QTextBlock currentBlock () const
QTextFrame * currentFrame () const
QTextFrame * parentFrame () const
bool operator!= (const iterator & other ) const
iterator & operator++ ()
iterator operator++ ( int )
iterator & operator-- ()
iterator operator-- ( int )
bool operator== (const iterator & other ) const

詳細描述

A frame consists of an arbitrary sequence of QTextBlock s and child QTextFrame s. This class provides a way to iterate over the child objects of a frame, and read their contents. It does not provide a way to modify the contents of the frame.

成員函數文檔編製

iterator:: iterator (const iterator & other )

Copy constructor. Constructs a copy of the other iterator.

iterator:: iterator ()

構造無效迭代器。

iterator &iterator:: operator= (const iterator & other )

賦值 other to this iterator and returns a reference to this iterator.

bool iterator:: atEnd () const

返迴 true if the current item is the last item in the text frame.

QTextBlock iterator:: currentBlock () const

Returns the current block the iterator points to. If the iterator points to a child frame, the returned block is invalid.

另請參閱 currentFrame ().

QTextFrame *iterator:: currentFrame () const

Returns the current frame pointed to by the iterator, or nullptr if the iterator currently points to a block.

另請參閱 currentBlock ().

QTextFrame *iterator:: parentFrame () const

返迴當前幀的父級幀。

另請參閱 currentFrame () 和 QTextFrame::parentFrame ().

bool iterator:: operator!= (const iterator & other ) const

Retuns true if the iterator is different from the other iterator; otherwise returns false .

iterator &iterator:: operator++ ()

將迭代器移到下一幀或塊。

另請參閱 currentBlock () 和 currentFrame ().

iterator iterator:: operator++ ( int )

The postfix ++ operator ( i++ ) advances the iterator to the next item in the text frame, and returns an iterator to the old item.

iterator &iterator:: operator-- ()

將迭代器移到上一幀或塊。

另請參閱 currentBlock () 和 currentFrame ().

iterator iterator:: operator-- ( int )

The postfix -- operator ( i-- ) makes the preceding item in the current frame, and returns an iterator to the old item.

bool iterator:: operator== (const iterator & other ) const

Retuns true if the iterator is the same as the other iterator; otherwise returns false .