Class: QgsTextBlock

class qgis.core.QgsTextBlock

Bases: sip.wrapper

Constructor for an empty text block.

QgsTextBlock(fragment: QgsTextFragment) Constructor for a QgsTextBlock consisting of a single text fragment.

QgsTextBlock(QgsTextBlock)

Represents a block of text consisting of one or more QgsTextFragment objects.

Warning

This API is not considered stable and may change in future QGIS versions.

Methods

append

Appends a fragment to the block.

at

Returns the fragment at the specified index.

clear

Clears the block, removing all its contents.

empty

Returns True if the block is empty.

size

Returns the number of fragments in the block.

append(self, fragment: QgsTextFragment)

Appends a fragment to the block.

Parameters

fragment (QgsTextFragment) –

at(self, index: int)QgsTextFragment

Returns the fragment at the specified index.

Parameters

index (int) –

Return type

QgsTextFragment

clear(self)

Clears the block, removing all its contents.

empty(self) → bool

Returns True if the block is empty.

Return type

bool

size(self) → int

Returns the number of fragments in the block.

Return type

int