TextLine
Qt Base Class: QTextLine
Signature: QTextLine(self) -> None
Base classes
Name |
Children |
Inherits |
QTextLine PySide6.QtGui QTextLine(self) -> None |
|
|
⋔ Inheritance diagram
graph TD
1473245553360["gui.TextLine"]
1473299676432["QtGui.QTextLine"]
1473291690208["Shiboken.Object"]
140713234304496["builtins.object"]
1473299676432 --> 1473245553360
1473291690208 --> 1473299676432
140713234304496 --> 1473291690208
🛈 DocStrings
Bases: QTextLine
Source code in prettyqt\gui\textline.py
| class TextLine(QtGui.QTextLine):
def __bool__(self):
return self.isValid()
def __repr__(self):
return get_repr(self)
def __len__(self):
return self.textLength()
def get_position(self) -> core.PointF:
return core.PointF(self.position())
def set_position(self, point: datatypes.PointType):
p = core.Point(*point) if isinstance(point, tuple) else point
self.setPosition(p)
def cursor_to_x(
self, cursor_pos: int, edge: EdgeStr | QtGui.QTextLine.Edge = "leading"
) -> float:
return self.cursorToX(cursor_pos, EDGE.get_enum_value(edge)) # type: ignore
def x_to_cursor(
self,
x: float,
cursor_pos: CursorPositionStr
| QtGui.QTextLine.CursorPosition = "cursor_between_characters",
) -> int:
return self.xToCursor(x, CURSOR_POSITION.get_enum_value(cursor_pos))
|