117 if ( a0 < 0 || a0 > sipCpp->size() )
119 PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
124 sipCpp->insert( a0, *a1 );
134 void insert(
int index, QgsTextBlock &&block )
SIP_SKIP;
139 void reserve(
int count );
146 const QgsTextBlock &at(
int index )
const SIP_FACTORY;
154 const QgsTextBlock &at(
int index )
const SIP_FACTORY;
156 if ( a0 < 0 || a0 >= sipCpp->size() )
158 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
163 sipRes =
new QgsTextBlock( sipCpp->at( a0 ) );
174 SIP_SSIZE_T idx = sipConvertFromSequenceIndex( a0, sipCpp->size() );
178 sipRes =
new QgsTextBlock( sipCpp->operator[]( idx ) );
190 sipRes = sipCpp->size();
197 QStringList toPlainText()
const;
208 void splitLines(
const QString &wrapCharacter,
int autoWrapLength = 0,
bool useMaxLineLengthWhenAutoWrapping =
true );
222 bool hasBackgrounds()
const;
226 QVector< QgsTextBlock >::const_iterator begin()
const;
227 QVector< QgsTextBlock >::const_iterator end()
const;
233 QVector< QgsTextBlock > mBlocks;
Represents a block of text consisting of one or more QgsTextFragment objects.
QgsTextDocument & operator=(const QgsTextDocument &other)
static QgsTextDocument fromHtml(const QStringList &lines)
Constructor for QgsTextDocument consisting of a set of HTML formatted lines.
static QgsTextDocument fromPlainText(const QStringList &lines)
Constructor for QgsTextDocument consisting of a set of plain text lines.
void append(const QgsTextBlock &block)
Appends a block to the document.
void insert(int index, const QgsTextBlock &block)
Inserts a block into the document, at the specified index.
static QgsTextDocument fromTextAndFormat(const QStringList &lines, const QgsTextFormat &format)
Constructor for QgsTextDocument consisting of a set of lines, respecting settings from a text format.
Stores a fragment of document along with formatting overrides to be used when rendering the fragment.