/************************************************************************ * This file has been generated automatically from * * * * src/core/textrenderer/qgstextblock.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ class QgsTextBlock { %Docstring(signature="appended") Represents a block of text consisting of one or more :py:class:`QgsTextFragment` objects. .. warning:: This API is not considered stable and may change in future QGIS versions. .. versionadded:: 3.14 %End %TypeHeaderCode #include "qgstextblock.h" %End public: QgsTextBlock(); %Docstring Constructor for an empty text block. %End explicit QgsTextBlock( const QgsTextFragment &fragment ); %Docstring Constructor for a QgsTextBlock consisting of a single text ``fragment``. %End QString toPlainText() const; %Docstring Converts the block to plain text. .. versionadded:: 3.16 %End void append( const QgsTextFragment &fragment ); %Docstring Appends a ``fragment`` to the block. %End void clear(); %Docstring Clears the block, removing all its contents. %End bool empty() const; %Docstring Returns ``True`` if the block is empty. %End int size() const; %Docstring Returns the number of fragments in the block. %End void applyCapitalization( Qgis::Capitalization capitalization ); %Docstring Applies a ``capitalization`` style to the block's text. .. versionadded:: 3.16 %End int __len__() const; %MethodCode sipRes = sipCpp->size(); %End const QgsTextFragment &at( int index ) const /Factory/; %Docstring Returns the fragment at the specified ``index``. :raises KeyError: if no fragment exists at the specified index. %End %MethodCode if ( a0 < 0 || a0 >= sipCpp->size() ) { PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) ); sipIsErr = 1; } else { sipRes = new QgsTextFragment( sipCpp->at( a0 ) ); } %End QgsTextFragment &operator[]( int index ) /Factory/; %MethodCode SIP_SSIZE_T idx = sipConvertFromSequenceIndex( a0, sipCpp->size() ); if ( idx < 0 ) sipIsErr = 1; else sipRes = new QgsTextFragment( sipCpp->operator[]( idx ) ); %End }; /************************************************************************ * This file has been generated automatically from * * * * src/core/textrenderer/qgstextblock.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/