QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
Represents a document consisting of one or more QgsTextBlock objects. More...
#include <qgstextdocument.h>
Public Member Functions | |
QgsTextDocument () | |
QgsTextDocument (const QgsTextBlock &block) | |
Constructor for a QgsTextDocument consisting of a single text block. | |
QgsTextDocument (const QgsTextFragment &fragment) | |
Constructor for a QgsTextDocument consisting of a single text fragment. | |
~QgsTextDocument () | |
void | append (const QgsTextBlock &block) |
Appends a block to the document. | |
void | append (QgsTextBlock &&block) |
Appends a block to the document. | |
void | applyCapitalization (Qgis::Capitalization capitalization) |
Applies a capitalization style to the document's text. | |
const QgsTextBlock & | at (int index) const |
Returns the block at the specified index. | |
QgsTextBlock & | operator[] (int index) |
Returns the block at the specified index. | |
void | reserve (int count) |
Reserves the specified count of blocks for optimised block appending. | |
int | size () const |
Returns the number of blocks in the document. | |
void | splitLines (const QString &wrapCharacter, int autoWrapLength=0, bool useMaxLineLengthWhenAutoWrapping=true) |
Splits lines of text in the document to separate lines, using a specified wrap character (wrapCharacter) or newline characters. | |
QStringList | toPlainText () const |
Returns a list of plain text lines of text representing the document. | |
Static Public Member Functions | |
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. | |
Represents a document consisting of one or more QgsTextBlock objects.
Definition at line 40 of file qgstextdocument.h.
|
default |
|
default |
|
explicit |
Constructor for a QgsTextDocument consisting of a single text block.
Definition at line 30 of file qgstextdocument.cpp.
|
explicit |
Constructor for a QgsTextDocument consisting of a single text fragment.
Definition at line 35 of file qgstextdocument.cpp.
void QgsTextDocument::append | ( | const QgsTextBlock & | block | ) |
Appends a block to the document.
Definition at line 87 of file qgstextdocument.cpp.
void QgsTextDocument::append | ( | QgsTextBlock && | block | ) |
Appends a block to the document.
Definition at line 92 of file qgstextdocument.cpp.
void QgsTextDocument::applyCapitalization | ( | Qgis::Capitalization | capitalization | ) |
Applies a capitalization style to the document's text.
Definition at line 192 of file qgstextdocument.cpp.
const QgsTextBlock & QgsTextDocument::at | ( | int | index | ) | const |
Returns the block at the specified index.
Definition at line 102 of file qgstextdocument.cpp.
|
static |
Constructor for QgsTextDocument consisting of a set of HTML formatted lines.
Definition at line 49 of file qgstextdocument.cpp.
|
static |
Constructor for QgsTextDocument consisting of a set of plain text lines.
Definition at line 40 of file qgstextdocument.cpp.
QgsTextBlock & QgsTextDocument::operator[] | ( | int | index | ) |
Returns the block at the specified index.
Definition at line 107 of file qgstextdocument.cpp.
void QgsTextDocument::reserve | ( | int | count | ) |
Reserves the specified count of blocks for optimised block appending.
Definition at line 97 of file qgstextdocument.cpp.
int QgsTextDocument::size | ( | ) | const |
Returns the number of blocks in the document.
Definition at line 112 of file qgstextdocument.cpp.
void QgsTextDocument::splitLines | ( | const QString & | wrapCharacter, |
int | autoWrapLength = 0 , |
||
bool | useMaxLineLengthWhenAutoWrapping = true |
||
) |
Splits lines of text in the document to separate lines, using a specified wrap character (wrapCharacter) or newline characters.
The autoWrapLength argument can be used to specify an ideal length of line to automatically wrap text to (automatic wrapping is disabled if autoWrapLength is 0). This automatic wrapping is performed after processing wrapping using wrapCharacter. When auto wrapping is enabled, the useMaxLineLengthWhenAutoWrapping argument controls whether the lines should be wrapped to an ideal maximum of autoWrapLength characters, or if false
then the lines are wrapped to an ideal minimum length of autoWrapLength characters.
Definition at line 133 of file qgstextdocument.cpp.
QStringList QgsTextDocument::toPlainText | ( | ) | const |
Returns a list of plain text lines of text representing the document.
Definition at line 117 of file qgstextdocument.cpp.