Skip to content

PythonQt.QtGui.QTextBlock · declarations 001

Back to PythonQt.QtGui.QTextBlock

begin

begin() -> Any

X.begin()

Supplemental documentation: Qt 5 reference:

QTextBlock::iterator QTextBlock::begin() const

Returns a text block iterator pointing to the beginning of the text block.

See also end().

Upstream PySide2 reference signatures (binding differences may apply):

begin(self) -> PySide2.QtGui.QTextBlock.iterator

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

blockFormat

blockFormat() -> Any

X.blockFormat() -> PythonQt.QtGui.QTextBlockFormat

Supplemental documentation: Qt 5 reference:

QTextBlockFormat QTextBlock::blockFormat() const

Returns the QTextBlockFormat that describes block-specific properties.

See also charFormat().

Upstream PySide2 reference signatures (binding differences may apply):

blockFormat(self) -> PySide2.QtGui.QTextBlockFormat

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#blockFormat

blockFormatIndex

blockFormatIndex() -> int

X.blockFormatIndex() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::blockFormatIndex() const

Returns an index into the document's internal list of block formats for the text block's format.

See also QTextDocument::allFormats().

Upstream PySide2 reference signatures (binding differences may apply):

blockFormatIndex(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#blockFormatIndex

blockNumber

blockNumber() -> int

X.blockNumber() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::blockNumber() const

Returns the number of this block, or -1 if the block is invalid.

This function was introduced in Qt 4.4.

See also QTextCursor::blockNumber().

Upstream PySide2 reference signatures (binding differences may apply):

blockNumber(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#blockNumber

charFormat

charFormat() -> Any

X.charFormat() -> PythonQt.QtGui.QTextCharFormat

Supplemental documentation: Qt 5 reference:

QTextCharFormat QTextBlock::charFormat() const

Returns the QTextCharFormat that describes the block's character format. The block's character format is used when inserting text into an empty block.

See also blockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

charFormat(self) -> PySide2.QtGui.QTextCharFormat

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#charFormat

charFormatIndex

charFormatIndex() -> int

X.charFormatIndex() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::charFormatIndex() const

Returns an index into the document's internal list of character formats for the text block's character format.

See also QTextDocument::allFormats().

Upstream PySide2 reference signatures (binding differences may apply):

charFormatIndex(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#charFormatIndex

clearLayout

clearLayout() -> None

X.clearLayout()

Supplemental documentation: Qt 5 reference:

void QTextBlock::clearLayout()

Clears the QTextLayout that is used to lay out and display the block's contents.

This function was introduced in Qt 4.4.

See also layout().

Upstream PySide2 reference signatures (binding differences may apply):

clearLayout(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#clearLayout

contains

contains(position: int) -> bool

X.contains(position) -> bool

Supplemental documentation: Qt 5 reference:

bool QTextBlock::contains(int position) const

Returns true if the given position is located within the text block; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

contains(self, position: int) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#contains

document

document() -> Any

X.document() -> PythonQt.QtGui.QTextDocument

Supplemental documentation: Qt 5 reference:

const QTextDocument *QTextBlock::document() const

Returns the text document this text block belongs to, or nullptr if the text block does not belong to any document.

Upstream PySide2 reference signatures (binding differences may apply):

document(self) -> PySide2.QtGui.QTextDocument

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#document

end

end() -> Any

X.end()

Supplemental documentation: Qt 5 reference:

QTextBlock::iterator QTextBlock::end() const

Returns a text block iterator pointing to the end of the text block.

See also begin(), next(), and previous().

Upstream PySide2 reference signatures (binding differences may apply):

end(self) -> PySide2.QtGui.QTextBlock.iterator

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#end

firstLineNumber

firstLineNumber() -> int

X.firstLineNumber() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::firstLineNumber() const

Returns the first line number of this block, or -1 if the block is invalid. Unless the layout supports it, the line number is identical to the block number.

This function was introduced in Qt 4.5.

See also QTextBlock::blockNumber().

Upstream PySide2 reference signatures (binding differences may apply):

firstLineNumber(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#firstLineNumber

fragmentIndex

fragmentIndex() -> int

X.fragmentIndex() -> int

Upstream PySide2 reference signatures (binding differences may apply):

fragmentIndex(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#fragmentIndex

isValid

isValid() -> bool

X.isValid() -> bool

Supplemental documentation: Qt 5 reference:

bool QTextBlock::isValid() const

Returns true if this text block is valid; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

isValid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#isValid

isVisible

isVisible() -> bool

X.isVisible() -> bool

Supplemental documentation: Qt 5 reference:

bool QTextBlock::isVisible() const

Returns true if the block is visible; otherwise returns false.

This function was introduced in Qt 4.4.

See also setVisible().

Upstream PySide2 reference signatures (binding differences may apply):

isVisible(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#isVisible

layout

layout() -> Any

X.layout() -> PythonQt.QtGui.QTextLayout

Supplemental documentation: Qt 5 reference:

QTextLayout *QTextBlock::layout() const

Returns the QTextLayout that is used to lay out and display the block's contents.

Note that the returned QTextLayout object can only be modified from the documentChanged implementation of a QAbstractTextDocumentLayout subclass. Any changes applied from the outside cause undefined behavior.

See also clearLayout().

Upstream PySide2 reference signatures (binding differences may apply):

layout(self) -> PySide2.QtGui.QTextLayout

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#layout

length

length() -> int

X.length() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::length() const

Returns the length of the block in characters.

Note: The length returned includes all formatting characters, for example, newline.

See also text(), charFormat(), and blockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

length(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#length

lineCount

lineCount() -> int

X.lineCount() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::lineCount() const

Returns the line count. Not all document layouts support this feature.

This function was introduced in Qt 4.5.

See also setLineCount().

Upstream PySide2 reference signatures (binding differences may apply):

lineCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#lineCount

next

next() -> Any

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

Supplemental documentation: Qt 5 reference:

QTextBlock QTextBlock::next() const

Returns the text block in the document after this block, or an empty text block if this is the last one.

Note that the next block may be in a different frame or table to this block.

See also previous(), begin(), and end().

Upstream PySide2 reference signatures (binding differences may apply):

next(self) -> PySide2.QtGui.QTextBlock

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#next

position

position() -> int

X.position() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::position() const

Returns the index of the block's first character within the document.

Upstream PySide2 reference signatures (binding differences may apply):

position(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#position

previous

previous() -> Any

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

Supplemental documentation: Qt 5 reference:

QTextBlock QTextBlock::previous() const

Returns the text block in the document before this block, or an empty text block if this is the first one.

Note that the previous block may be in a different frame or table to this block.

See also next(), begin(), and end().

Upstream PySide2 reference signatures (binding differences may apply):

previous(self) -> PySide2.QtGui.QTextBlock

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#previous

revision

revision() -> int

X.revision() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::revision() const

Returns the blocks revision.

This function was introduced in Qt 4.4.

See also setRevision() and QTextDocument::revision().

Upstream PySide2 reference signatures (binding differences may apply):

revision(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#revision

setLineCount

setLineCount(count: int) -> None

X.setLineCount(count)

Supplemental documentation: Qt 5 reference:

void QTextBlock::setLineCount(int count)

Sets the line count to count.

This function was introduced in Qt 4.5.

See also lineCount().

Upstream PySide2 reference signatures (binding differences may apply):

setLineCount(self, count: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#setLineCount

setRevision

setRevision(rev: int) -> None

X.setRevision(rev)

Supplemental documentation: Qt 5 reference:

void QTextBlock::setRevision(int rev)

Sets a blocks revision to rev.

This function was introduced in Qt 4.4.

See also revision() and QTextDocument::revision().

Upstream PySide2 reference signatures (binding differences may apply):

setRevision(self, rev: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#setRevision

setUserData

setUserData(data: Any) -> None

X.setUserData(data)

Supplemental documentation: Qt 5 reference:

void QTextBlock::setUserData(QTextBlockUserData *data)

Attaches the given data object to the text block.

QTextBlockUserData can be used to store custom settings. The ownership is passed to the underlying text document, i.e. the provided QTextBlockUserData object will be deleted if the corresponding text block gets deleted. The user data object is not stored in the undo history, so it will not be available after undoing the deletion of a text block.

For example, if you write a programming editor in an IDE, you may want to let your user set breakpoints visually in your code for an integrated debugger. In a programming editor a line of text usually corresponds to one QTextBlock. The QTextBlockUserData interface allows the developer to store data for each QTextBlock, like for example in which lines of the source code the user has a breakpoint set. Of course this could also be stored externally, but by storing it inside the QTextDocument, it will for example be automatically deleted when the user deletes the associated line. It's really just a way to store custom information in the QTextDocument without using custom properties in QTextFormat which would affect the undo/redo stack.

This function was introduced in Qt 4.1.

See also userData().

Upstream PySide2 reference signatures (binding differences may apply):

setUserData(self, data: PySide2.QtGui.QTextBlockUserData) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#setUserData

setUserState

setUserState(state: int) -> None

X.setUserState(state)

Supplemental documentation: Qt 5 reference:

void QTextBlock::setUserState(int state)

Stores the specified state integer value in the text block. This may be useful for example in a syntax highlighter to store a text parsing state.

This function was introduced in Qt 4.1.

See also userState().

Upstream PySide2 reference signatures (binding differences may apply):

setUserState(self, state: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#setUserState

setVisible

setVisible(visible: bool) -> None

X.setVisible(visible)

Supplemental documentation: Qt 5 reference:

void QTextBlock::setVisible(bool visible)

Sets the block's visibility to visible.

This function was introduced in Qt 4.4.

See also isVisible().

Upstream PySide2 reference signatures (binding differences may apply):

setVisible(self, visible: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#setVisible

text

text() -> str

X.text() -> str

Supplemental documentation: Qt 5 reference:

QString QTextBlock::text() const

Returns the block's contents as plain text.

See also length(), charFormat(), and blockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

text(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#text

textDirection

textDirection() -> Any

X.textDirection()

Supplemental documentation: Qt 5 reference:

Qt::LayoutDirection QTextBlock::textDirection() const

Returns the resolved text direction.

If the block has no explicit direction set, it will resolve the direction from the blocks content. Returns either Qt::LeftToRight or Qt::RightToLeft.

This function was introduced in Qt 4.7.

See also QTextFormat::layoutDirection(), QString::isRightToLeft(), and Qt::LayoutDirection.

Upstream PySide2 reference signatures (binding differences may apply):

textDirection(self) -> PySide2.QtCore.Qt.LayoutDirection

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#textDirection

textFormats

textFormats() -> tuple

X.textFormats() -> tuple

Supplemental documentation: Qt 5 reference:

QVector\<QTextLayout::FormatRange> QTextBlock::textFormats() const

Returns the block's text format options as a list of continuous ranges of QTextCharFormat. The range's character format is used when inserting text within the range boundaries.

This function was introduced in Qt 5.3.

See also charFormat() and blockFormat().

Upstream PySide2 reference signatures (binding differences may apply):

textFormats(self) -> typing.List[PySide2.QtGui.QTextLayout.FormatRange]

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#textFormats

textList

textList() -> Any

X.textList() -> PythonQt.QtGui.QTextList

Supplemental documentation: Qt 5 reference:

QTextList *QTextBlock::textList() const

If the block represents a list item, returns the list that the item belongs to; otherwise returns nullptr.

Upstream PySide2 reference signatures (binding differences may apply):

textList(self) -> PySide2.QtGui.QTextList

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#textList

userData

userData() -> Any

X.userData() -> PythonQt.QtGui.QTextBlockUserData

Supplemental documentation: Qt 5 reference:

QTextBlockUserData *QTextBlock::userData() const

Returns a pointer to a QTextBlockUserData object, if one has been set with setUserData(), or nullptr.

This function was introduced in Qt 4.1.

See also setUserData().

Upstream PySide2 reference signatures (binding differences may apply):

userData(self) -> PySide2.QtGui.QTextBlockUserData

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#userData

userState

userState() -> int

X.userState() -> int

Supplemental documentation: Qt 5 reference:

int QTextBlock::userState() const

Returns the integer value previously set with setUserState() or -1.

This function was introduced in Qt 4.1.

See also setUserState().

Upstream PySide2 reference signatures (binding differences may apply):

userState(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextblock.html#userState