Skip to content

PythonQt.QtGui.QTextDocument · declarations 001

Back to PythonQt.QtGui.QTextDocument

DocumentTitle instance-attribute

DocumentTitle: Any

DocumentUrl instance-attribute

DocumentUrl: Any

FindBackward instance-attribute

FindBackward: Any

FindCaseSensitively instance-attribute

FindCaseSensitively: Any

FindFlag instance-attribute

FindFlag: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

FindFlags instance-attribute

FindFlags: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

FindWholeWords instance-attribute

FindWholeWords: Any

HtmlResource instance-attribute

HtmlResource: Any

ImageResource instance-attribute

ImageResource: Any

MarkdownFeatures instance-attribute

MarkdownFeatures: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

MarkdownResource instance-attribute

MarkdownResource: Any

MetaInformation instance-attribute

MetaInformation: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

RedoStack instance-attribute

RedoStack: Any

ResourceType instance-attribute

ResourceType: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

Stacks instance-attribute

Stacks: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

StyleSheetResource instance-attribute

StyleSheetResource: Any

UndoAndRedoStacks instance-attribute

UndoAndRedoStacks: Any

UndoStack instance-attribute

UndoStack: Any

UnknownResource instance-attribute

UnknownResource: Any

UserResource instance-attribute

UserResource: Any

addResource

addResource(type: int, name: Any, resource: Any) -> None

X.addResource(type, name, resource)

Supplemental documentation: Qt 5 reference:

void QTextDocument::addResource(int type, const QUrl \&name, const QVariant \&resource)

Adds the resource resource to the resource cache, using type and name as identifiers. type should be a value from QTextDocument::ResourceType.

For example, you can add an image as a resource in order to reference it from within the document:

    document->addResource(QTextDocument::ImageResource,
        QUrl("mydata://image.png"), QVariant(image));

The image can be inserted into the document using the QTextCursor API:

    QTextImageFormat imageFormat;
    imageFormat.setName("mydata://image.png");
    cursor.insertImage(imageFormat);

Alternatively, you can insert images using the HTML img tag:

    editor->append("<img src=\"mydata://image.png\" />");

Upstream PySide2 reference signatures (binding differences may apply):

addResource(self, type: int, name: PySide2.QtCore.QUrl, resource: typing.Any) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#addResource

adjustSize

adjustSize() -> None

X.adjustSize()

Supplemental documentation: Qt 5 reference:

void QTextDocument::adjustSize()

Adjusts the document to a reasonable size.

This function was introduced in Qt 4.2.

See also idealWidth(), textWidth, and size.

Upstream PySide2 reference signatures (binding differences may apply):

adjustSize(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#adjustSize

allFormats

allFormats() -> tuple

X.allFormats() -> tuple

Supplemental documentation: Qt 5 reference:

QVector\<QTextFormat> QTextDocument::allFormats() const

Returns a vector of text formats for all the formats used in the document.

Upstream PySide2 reference signatures (binding differences may apply):

allFormats(self) -> typing.List[PySide2.QtGui.QTextFormat]

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#allFormats

appendUndoItem

appendUndoItem(a: Any) -> Any

X.appendUndoItem(a)

availableRedoSteps

availableRedoSteps() -> int

X.availableRedoSteps() -> int

Supplemental documentation: Qt 5 reference:

int QTextDocument::availableRedoSteps() const

Returns the number of available redo steps.

This function was introduced in Qt 4.6.

See also isRedoAvailable().

Upstream PySide2 reference signatures (binding differences may apply):

availableRedoSteps(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#availableRedoSteps

availableUndoSteps

availableUndoSteps() -> int

X.availableUndoSteps() -> int

Supplemental documentation: Qt 5 reference:

int QTextDocument::availableUndoSteps() const

Returns the number of available undo steps.

This function was introduced in Qt 4.6.

See also isUndoAvailable().

Upstream PySide2 reference signatures (binding differences may apply):

availableUndoSteps(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#availableUndoSteps

baseUrl instance-attribute

baseUrl: QUrl

Qt 5 reference:

baseUrl : QUrl

This property holds the base URL used to resolve relative resource URLs within the document.

Resource URLs are resolved to be within the same directory as the target of the base URL meaning any portion of the path after the last '/' will be ignored.

Base URL Relative URL Resolved URL
file:///path/to/content images/logo.png file:///path/to/images/logo.png
file:///path/to/content/ images/logo.png file:///path/to/content/images/logo.png
file:///path/to/content/index.html images/logo.png file:///path/to/content/images/logo.png
file:///path/to/content/images/ ../images/logo.png file:///path/to/content/images/logo.png

This property was introduced in Qt 5.3.

Access functions:

QUrl baseUrl() const
void setBaseUrl(const QUrl \&url)

Notifier signal:

void baseUrlChanged(const QUrl \&url)

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#baseUrl

baseUrlChanged

baseUrlChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QTextDocument.baseUrlChanged; argument details are not documented.

begin

begin() -> Any

X.begin() -> PythonQt.QtGui.QTextBlock

Supplemental documentation: Qt 5 reference:

QTextBlock QTextDocument::begin() const

Returns the document's first text block.

See also firstBlock().

Upstream PySide2 reference signatures (binding differences may apply):

begin(self) -> PySide2.QtGui.QTextBlock

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#begin

blockCount instance-attribute

blockCount: int

Qt 5 reference:

blockCount : const int

Returns the number of text blocks in the document.

The value of this property is undefined in documents with tables or frames.

By default, if defined, this property contains a value of 1.

This property was introduced in Qt 4.2.

Access functions:

int blockCount() const

See also lineCount() and characterCount().

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#blockCount

blockCountChanged

blockCountChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QTextDocument.blockCountChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QTextDocument::blockCountChanged(int newBlockCount)

This signal is emitted when the total number of text blocks in the document changes. The value passed in newBlockCount is the new total.

This function was introduced in Qt 4.3.

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#blockCountChanged

characterAt

characterAt(pos: int) -> str

X.characterAt(pos)

Supplemental documentation: Qt 5 reference:

QChar QTextDocument::characterAt(int pos) const

Returns the character at position pos, or a null character if the position is out of range.

This function was introduced in Qt 4.5.

See also characterCount().

Upstream PySide2 reference signatures (binding differences may apply):

characterAt(self, pos: int) -> str

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#characterAt

characterCount

characterCount() -> int

X.characterCount() -> int

Supplemental documentation: Qt 5 reference:

int QTextDocument::characterCount() const

Returns the number of characters of this document.

Note: As a QTextDocument always contains at least one QChar::ParagraphSeparator, this method will return at least 1.

This function was introduced in Qt 4.5.

See also blockCount() and characterAt().

Upstream PySide2 reference signatures (binding differences may apply):

characterCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#characterCount

clear

clear() -> None

X.clear()

Supplemental documentation: Qt 5 reference:

[virtual] void QTextDocument::clear()

Clears the document.

Upstream PySide2 reference signatures (binding differences may apply):

clear(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#clear

clearUndoRedoStacks

clearUndoRedoStacks(historyToClear: Any) -> None

X.clearUndoRedoStacks(historyToClear)

Supplemental documentation: Qt 5 reference:

void QTextDocument::clearUndoRedoStacks(QTextDocument::Stacks stacksToClear \= UndoAndRedoStacks)

Clears the stacks specified by stacksToClear.

This method clears any commands on the undo stack, the redo stack, or both (the default). If commands are cleared, the appropriate signals are emitted, QTextDocument::undoAvailable() or QTextDocument::redoAvailable().

This function was introduced in Qt 4.7.

See also QTextDocument::undoAvailable() and QTextDocument::redoAvailable().

Upstream PySide2 reference signatures (binding differences may apply):

clearUndoRedoStacks(self, historyToClear: PySide2.QtGui.QTextDocument.Stacks=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#clearUndoRedoStacks

clone

clone(parent: Any) -> Any

X.clone(parent) -> PythonQt.QtGui.QTextDocument

Supplemental documentation: Qt 5 reference:

QTextDocument *QTextDocument::clone(QObject *parent \= nullptr) const

Creates a new QTextDocument that is a copy of this text document. parent is the parent of the returned text document.

Upstream PySide2 reference signatures (binding differences may apply):

clone(self, parent: typing.Optional[PySide2.QtCore.QObject]=...) -> PySide2.QtGui.QTextDocument

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#clone

contentsChange

contentsChange(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QTextDocument.contentsChange; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QTextDocument::contentsChange(int position, int charsRemoved, int charsAdded)

This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.

Information is provided about the position of the character in the document where the change occurred, the number of characters removed (charsRemoved), and the number of characters added (charsAdded).

The signal is emitted before the document's layout manager is notified about the change. This hook allows you to implement syntax highlighting for the document.

See also QAbstractTextDocumentLayout::documentChanged() and contentsChanged().

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#contentsChange

contentsChanged

contentsChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QTextDocument.contentsChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QTextDocument::contentsChanged()

This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.

See also contentsChange().

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#contentsChanged

createObject

createObject(f: Any) -> Any

X.createObject(f) -> PythonQt.QtGui.QTextObject

Supplemental documentation: Qt 5 reference:

[virtual protected] QTextObject *QTextDocument::createObject(const QTextFormat \&format)

Creates and returns a new document object (a QTextObject), based on the given format.

QTextObjects will always get created through this method, so you must reimplement it if you use custom text objects inside your document.

Upstream PySide2 reference signatures (binding differences may apply):

createObject(self, f: PySide2.QtGui.QTextFormat) -> PySide2.QtGui.QTextObject

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#createObject

cursorPositionChanged

cursorPositionChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QTextDocument.cursorPositionChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QTextDocument::cursorPositionChanged(const QTextCursor \&cursor)

This signal is emitted whenever the position of a cursor changed due to an editing operation. The cursor that changed is passed in cursor. If the document is used with the QTextEdit class and you need a signal when the cursor is moved with the arrow keys you can use the cursorPositionChanged() signal in QTextEdit.

Source: https://doc.qt.io/archives/qt-5.15/qtextdocument.html#cursorPositionChanged