内容表

上一话题

QTextBlockFormat

下一话题

QTextBlockUserData

QTextBlockGroup

QTextBlockGroup class provides a container for text blocks within a QTextDocument . 更多

Inheritance diagram of PySide2.QtGui.QTextBlockGroup

继承者: QTextList

概要

函数

虚函数

详细描述

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() 被调用。

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.

class QTextBlockGroup ( doc )
param doc

QTextDocument

Creates a new new block group for the given document .

警告

This function should only be called from createObject() .

PySide2.QtGui.QTextBlockGroup. blockFormatChanged ( block )
参数

block QTextBlock

This function is called whenever the specified block of text is changed. The text block is a member of this group.

基类实现什么都不做。

PySide2.QtGui.QTextBlockGroup. blockInserted ( block )
参数

block QTextBlock

Appends the given block to the end of the group.

警告

If you reimplement this function you must call the base class implementation.

PySide2.QtGui.QTextBlockGroup. blockList ( )
返回类型

Returns a (possibly empty) list of all the blocks that are part of the block group.

PySide2.QtGui.QTextBlockGroup. blockRemoved ( block )
参数

block QTextBlock

移除给定 block from the group; the block itself is not deleted, it simply isn’t a member of this group anymore.