TextCursor
Qt Base Class: QTextCursor
Signature: QTextCursor(self) -> None
QTextCursor(self, block: PySide6.QtGui.QTextBlock) -> None
QTextCursor(self, cursor: PySide6.QtGui.QTextCursor) -> None
QTextCursor(self, document: PySide6.QtGui.QTextDocument) -> None
QTextCursor(self, frame: PySide6.QtGui.QTextFrame) -> None
Base classes
Name | Children | Inherits |
---|---|---|
QTextCursor PySide6.QtGui QTextCursor(self) -> None |
⋔ Inheritance diagram
graph TD
1473245638272["gui.TextCursor"]
1473299704736["QtGui.QTextCursor"]
1473291690208["Shiboken.Object"]
140713234304496["builtins.object"]
1473299704736 --> 1473245638272
1473291690208 --> 1473299704736
140713234304496 --> 1473291690208
🛈 DocStrings
Bases: QTextCursor
Source code in prettyqt\gui\textcursor.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
edit_block(join_previous: bool = False)
Context manager for edit blocks. Can be used for undo actions.
Source code in prettyqt\gui\textcursor.py
get_cursor_position() -> tuple[int, int]
Return the QTextCursor position.
The position is a tuple made up of the line number (0 based) and the column number (0 based). :return: tuple(line, column)
Source code in prettyqt\gui\textcursor.py
select_text(start_pos: int | tuple[int, int] | MoveOperationStr, end_pos: int | tuple[int, int] | MoveOperationStr) -> str
Select text from start position to end position.
Positions can be either an integer index or a move operation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_pos |
int | tuple[int, int] | MoveOperationStr
|
Start position |
required |
end_pos |
int | tuple[int, int] | MoveOperationStr
|
End position |
required |
Source code in prettyqt\gui\textcursor.py
set_position(pos: int | tuple[int, int], mode: MoveModeStr = 'move')
Set cursor to given position.
0-indexed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pos |
int | tuple[int, int]
|
Cursor position |
required |
mode |
MoveModeStr
|
Move mode |
'move'
|