Class: QgsTextBlock¶
-
class
qgis.core.
QgsTextBlock
¶ Bases:
sip.wrapper
Constructor for an empty text block.
QgsTextBlock(fragment:
QgsTextFragment
) Constructor for aQgsTextBlock
consisting of a single textfragment
.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
Appends a
fragment
to the block.Returns the fragment at the specified
index
.Clears the block, removing all its contents.
Returns
True
if the block is empty.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
-
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
-