Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QTextBlockGroup Class Reference

The QTextBlockGroup class provides a container for text blocks within a QTextDocument. More...

    #include <QTextBlockGroup>

Inherits QTextObject.

Inherited by QTextList.

- List of all members, including inherited members

### Writable Properties

- 1 writable property inherited from QObject

### Public Functions

- 3 public functions inherited from QTextObject
- 24 public functions inherited from QObject

### Public Slots

- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QObject

### Protected Functions

- 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 protected function inherited from QTextObject
- 9 protected functions inherited from QObject

## Detailed Description

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().

See also QTextBlock and QTextDocument.

## Member Function Documentation

### QTextBlockGroup::QTextBlockGroup ( QTextDocument * document ) `[protected]`

Creates a new new block group for the given document.

Warning: This function should only be called from QTextDocument::createObject().

### QTextBlockGroup::~QTextBlockGroup () `[protected]`

Destroys this block group; the blocks are not deleted, they simply don't belong to this block anymore.

### void QTextBlockGroup::blockFormatChanged ( const QTextBlock & block ) `[virtual protected]`

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.

### void QTextBlockGroup::blockInserted ( const QTextBlock & block ) `[virtual protected]`

Appends the given block to the end of the group.

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

### QList<QTextBlock> QTextBlockGroup::blockList () const `[protected]`

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

### void QTextBlockGroup::blockRemoved ( const QTextBlock & block ) `[virtual protected]`

Removes the given block from the group; the block itself is not deleted, it simply isn't a member of this group anymore.