103 if ( a0 < 0 || a0 > sipCpp->size() )
105 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
110 sipCpp->insert( a0, *a1 );
121 void insert(
int index, QgsTextFragment &&fragment )
SIP_SKIP;
168 bool hasBackgrounds()
const;
174 sipRes = sipCpp->size();
195 if ( a0 < 0 || a0 >= sipCpp->size() )
197 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
202 sipRes =
new QgsTextFragment( sipCpp->at( a0 ) );
211 QgsTextFragment &operator[](
int index )
SIP_FACTORY;
215 SIP_SSIZE_T idx = sipConvertFromSequenceIndex( a0, sipCpp->size() );
219 sipRes =
new QgsTextFragment( sipCpp->operator[]( idx ) );
226 QVector< QgsTextFragment >::const_iterator begin()
const;
227 QVector< QgsTextFragment >::const_iterator end()
const;
232 QVector< QgsTextFragment > mFragments;
233 QgsTextBlockFormat mBlockFormat;
void insert(int index, const QgsTextFragment &fragment)
Inserts a fragment into the block, at the specified index.
QString toPlainText() const
Converts the block to plain text.
const QgsTextBlockFormat & blockFormat() const
Returns the block formatting for the fragment.
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 reserve(int count)
Reserves the specified count of fragments for optimised fragment appending.
void append(const QgsTextFragment &fragment)
Appends a fragment to the block.
Stores a fragment of document along with formatting overrides to be used when rendering the fragment.