Skip to content

PythonQt.QtGui.QTextCursor · declarations 003

Back to PythonQt.QtGui.QTextCursor

setPosition

setPosition(pos: int, mode: Any) -> None

X.setPosition(pos, mode)

Supplemental documentation: Qt 5 reference:

void QTextCursor::setPosition(int pos, QTextCursor::MoveMode m \= MoveAnchor)

Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified by m. The cursor is positioned between characters.

Note: The "characters" in this case refer to the string of QChar objects, i.e. 16-bit Unicode characters, and pos is considered an index into this string. This does not necessarily correspond to individual graphemes in the writing system, as a single grapheme may be represented by multiple Unicode characters, such as in the case of surrogate pairs, linguistic ligatures or diacritics. For a more generic approach to navigating the document, use movePosition(), which will respect the actual grapheme boundaries in the text.

See also position(), movePosition(), and anchor().

Upstream PySide2 reference signatures (binding differences may apply):

setPosition(self, pos: int, mode: PySide2.QtGui.QTextCursor.MoveMode=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setPosition

setVerticalMovementX

setVerticalMovementX(x: int) -> None

X.setVerticalMovementX(x)

Supplemental documentation: Qt 5 reference:

void QTextCursor::setVerticalMovementX(int x)

Sets the visual x position for vertical cursor movements to x.

The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a visually straight line with proportional fonts, and to gently "jump" over short lines.

A value of -1 indicates no predefined x position. It will then be set automatically the next time the cursor moves up or down.

This function was introduced in Qt 4.7.

See also verticalMovementX().

Upstream PySide2 reference signatures (binding differences may apply):

setVerticalMovementX(self, x: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setVerticalMovementX

setVisualNavigation

setVisualNavigation(b: bool) -> None

X.setVisualNavigation(b)

Supplemental documentation: Qt 5 reference:

void QTextCursor::setVisualNavigation(bool b)

Sets visual navigation to b.

Visual navigation means skipping over hidden text paragraphs. The default is false.

This function was introduced in Qt 4.4.

See also visualNavigation() and movePosition().

Upstream PySide2 reference signatures (binding differences may apply):

setVisualNavigation(self, b: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#setVisualNavigation

swap

swap(other: Any) -> None

X.swap(other)

Supplemental documentation: Qt 5 reference:

void QTextCursor::swap(QTextCursor \&other)

Swaps this text cursor instance with other. This function is very fast and never fails.

This function was introduced in Qt 5.0.

Upstream PySide2 reference signatures (binding differences may apply):

swap(self, other: PySide2.QtGui.QTextCursor) -> None

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#swap

verticalMovementX

verticalMovementX() -> int

X.verticalMovementX() -> int

Supplemental documentation: Qt 5 reference:

int QTextCursor::verticalMovementX() const

Returns the visual x position for vertical cursor movements.

A value of -1 indicates no predefined x position. It will then be set automatically the next time the cursor moves up or down.

This function was introduced in Qt 4.7.

See also setVerticalMovementX().

Upstream PySide2 reference signatures (binding differences may apply):

verticalMovementX(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#verticalMovementX

visualNavigation

visualNavigation() -> bool

X.visualNavigation() -> bool

Supplemental documentation: Qt 5 reference:

bool QTextCursor::visualNavigation() const

Returns true if the cursor does visual navigation; otherwise returns false.

Visual navigation means skipping over hidden text paragraphs. The default is false.

This function was introduced in Qt 4.4.

See also setVisualNavigation() and movePosition().

Upstream PySide2 reference signatures (binding differences may apply):

visualNavigation(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qtextcursor.html#visualNavigation