Represents a block of text consisting of one or more QgsTextFragment objects.
int size() const
Returns the number of fragments in the block.
void applyCapitalization(Qgis::Capitalization capitalization)
Applies a capitalization style to the block's text.
QString toPlainText() const
Converts the block to plain text.
QgsTextFragment & operator[](int index)
Returns the fragment at the specified index.
void clear()
Clears the block, removing all its contents.
static QgsTextBlock fromPlainText(const QString &text, const QgsTextCharacterFormat &format=QgsTextCharacterFormat())
Constructor for QgsTextBlock consisting of a plain text, and optional character format.
QgsTextBlock()=default
Constructor for an empty text block.
void append(const QgsTextFragment &fragment)
Appends a fragment to the block.
const QgsTextFragment & at(int index) const
Returns the fragment at the specified index.
bool empty() const
Returns true if the block is empty.
Stores a fragment of text along with formatting overrides to be used when rendering the fragment.