QTextBlockGroup Class
The QTextBlockGroup class provides a container for text blocks within a QTextDocument. 更多...
头文件: | #include <QTextBlockGroup> |
qmake: | QT += gui |
基类: | QTextObject |
派生类: |
Note: All functions in this class are reentrant.
受保护的函数
QTextBlockGroup(QTextDocument *document) | |
~QTextBlockGroup() | |
virtual void | blockFormatChanged(const QTextBlock &block) |
virtual void | blockInserted(const QTextBlock &block) |
QList<QTextBlock> | blockList() const |
virtual void | blockRemoved(const QTextBlock &block) |
- 1 个受保护的函数继承自 QTextObject
- 9 个受保护的函数继承自 QObject
其他继承的成员
- 1 个属性继承自 QObject
- 4 个公有函数继承自 QTextObject
- 32 个公有函数继承自 QObject
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
The QTextBlockGroup class provides a container for text blocks within a QTextDocument.
Block groups can be used to organize blocks of text within a document. They maintain an up-to-date list of the text blocks that belong to them, even when text blocks are being edited.
Each group has a parent document which is specified when the group is constructed.
Text blocks can be inserted into a group with blockInserted(), and removed with blockRemoved(). If a block's format is changed, blockFormatChanged() is called.
The list of blocks in the group is returned by blockList(). Note that the blocks in the list are not necessarily adjacent elements in the document; for example, the top-level items in a multi-level list will be separated by the items in lower levels of the list.
参见 QTextBlock and QTextDocument.
成员函数
[protected]
QTextBlockGroup::QTextBlockGroup(QTextDocument *document)
Creates a new new block group for the given document.
Warning: This function should only be called from QTextDocument::createObject().
[protected]
QTextBlockGroup::~QTextBlockGroup()
Destroys this block group; the blocks are not deleted, they simply don't belong to this block anymore.
[virtual protected]
void QTextBlockGroup::blockFormatChanged(const QTextBlock &block)
This function is called whenever the specified block of text is changed. The text block is a member of this group.
The base class implementation does nothing.
[virtual protected]
void QTextBlockGroup::blockInserted(const QTextBlock &block)
Appends the given block to the end of the group.
Warning: If you reimplement this function you must call the base class implementation.
[protected]
QList<QTextBlock> QTextBlockGroup::blockList() const
Returns a (possibly empty) list of all the blocks that are part of the block group.
[virtual protected]
void QTextBlockGroup::blockRemoved(const QTextBlock &block)
Removes the given block from the group; the block itself is not deleted, it simply isn't a member of this group anymore.