PythonQt.QtGui.QTextDocumentFragment · declarations 001
Back to PythonQt.QtGui.QTextDocumentFragment
fromHtml
fromHtml(html: str, resourceProvider: Any) -> Any
X.fromHtml(html, resourceProvider) -> PythonQt.QtGui.QTextDocumentFragment
Supplemental documentation: Qt 5 reference:
[static] QTextDocumentFragment QTextDocumentFragment::fromHtml(const QString \&text)
Returns a QTextDocumentFragment based on the arbitrary piece of HTML in the given text. The formatting is preserved as much as possible; for example, "\<b>bold\</b>" will become a document fragment with the text "bold" with a bold character format.
[static] QTextDocumentFragment QTextDocumentFragment::fromHtml(const QString \&text, const QTextDocument *resourceProvider)
Returns a QTextDocumentFragment based on the arbitrary piece of HTML in the given text. The formatting is preserved as much as possible; for example, "\<b>bold\</b>" will become a document fragment with the text "bold" with a bold character format.
If the provided HTML contains references to external resources such as imported style sheets, then they will be loaded through the resourceProvider.
This function was introduced in Qt 4.2.
Upstream PySide2 reference signatures (binding differences may apply):
fromHtml(html: str) -> PySide2.QtGui.QTextDocumentFragment
fromHtml(html: str, resourceProvider: PySide2.QtGui.QTextDocument) -> PySide2.QtGui.QTextDocumentFragment
Source: https://doc.qt.io/archives/qt-5.15/qtextdocumentfragment.html#fromHtml
fromPlainText
fromPlainText(plainText: str) -> Any
X.fromPlainText(plainText) -> PythonQt.QtGui.QTextDocumentFragment
Supplemental documentation: Qt 5 reference:
[static] QTextDocumentFragment QTextDocumentFragment::fromPlainText(const QString \&plainText)
Returns a document fragment that contains the given plainText.
When inserting such a fragment into a QTextDocument the current char format of the QTextCursor used for insertion is used as format for the text.
Upstream PySide2 reference signatures (binding differences may apply):
fromPlainText(plainText: str) -> PySide2.QtGui.QTextDocumentFragment
Source: https://doc.qt.io/archives/qt-5.15/qtextdocumentfragment.html#fromPlainText
isEmpty
isEmpty() -> bool
X.isEmpty() -> bool
Supplemental documentation: Qt 5 reference:
bool QTextDocumentFragment::isEmpty() const
Returns true if the fragment is empty; otherwise returns false.
Upstream PySide2 reference signatures (binding differences may apply):
isEmpty(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qtextdocumentfragment.html#isEmpty
toHtml
toHtml(encoding: Any) -> str
X.toHtml(encoding) -> str
Supplemental documentation: Qt 5 reference:
QString QTextDocumentFragment::toHtml(const QByteArray \&encoding \= QByteArray()) const
Returns the contents of the document fragment as HTML, using the specified encoding (e.g., "UTF-8", "ISO 8859-1").
This function was introduced in Qt 4.2.
See also toPlainText(), QTextDocument::toHtml(), and QTextCodec.
Upstream PySide2 reference signatures (binding differences may apply):
toHtml(self, encoding: PySide2.QtCore.QByteArray=...) -> str
Source: https://doc.qt.io/archives/qt-5.15/qtextdocumentfragment.html#toHtml
toPlainText
toPlainText() -> str
X.toPlainText() -> str
Supplemental documentation: Qt 5 reference:
QString QTextDocumentFragment::toPlainText() const
Returns the document fragment's text as plain text (i.e. with no formatting information).
See also toHtml().
Upstream PySide2 reference signatures (binding differences may apply):
toPlainText(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qtextdocumentfragment.html#toPlainText