QTextInlineObject#
The QTextInlineObject
class represents an inline object in a QAbstractTextDocumentLayout
and its implementations. More…
Synopsis#
Functions#
def
ascent
()def
descent
()def
format
()def
formatIndex
()def
height
()def
isValid
()def
rect
()def
setAscent
(a)def
setDescent
(d)def
setWidth
(w)def
textDirection
()def
textPosition
()def
width
()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
Normally, you do not need to create a QTextInlineObject
. It is used by QAbstractTextDocumentLayout
to handle inline objects when implementing a custom layout.
The inline object has various attributes that can be set, for example using, setWidth()
, setAscent()
, and setDescent()
. The rectangle it occupies is given by rect()
, and its direction by textDirection()
. Its position in the text layout is given by textPosition()
, and its format is given by format()
.
- class PySide6.QtGui.QTextInlineObject#
- PySide6.QtGui.QTextInlineObject.ascent()#
- Return type:
float
Returns the inline object’s ascent.
See also
- PySide6.QtGui.QTextInlineObject.descent()#
- Return type:
float
Returns the inline object’s descent.
See also
- PySide6.QtGui.QTextInlineObject.format()#
- Return type:
Returns format of the inline object within the text layout.
- PySide6.QtGui.QTextInlineObject.formatIndex()#
- Return type:
int
Returns an integer describing the format of the inline object within the text layout.
- PySide6.QtGui.QTextInlineObject.height()#
- Return type:
float
Returns the inline object’s total height. This is equal to ascent()
+ descent()
+ 1.
- PySide6.QtGui.QTextInlineObject.isValid()#
- Return type:
bool
Returns true
if this inline object is valid; otherwise returns false.
- PySide6.QtGui.QTextInlineObject.rect()#
- Return type:
Returns the inline object’s rectangle.
- PySide6.QtGui.QTextInlineObject.setAscent(a)#
- Parameters:
a – float
Sets the inline object’s ascent to a
.
See also
- PySide6.QtGui.QTextInlineObject.setDescent(d)#
- Parameters:
d – float
Sets the inline object’s descent to d
.
See also
- PySide6.QtGui.QTextInlineObject.setWidth(w)#
- Parameters:
w – float
Sets the inline object’s width to w
.
- PySide6.QtGui.QTextInlineObject.textDirection()#
- Return type:
Returns if the object should be laid out right-to-left or left-to-right.
- PySide6.QtGui.QTextInlineObject.textPosition()#
- Return type:
int
The position of the inline object within the text layout.
- PySide6.QtGui.QTextInlineObject.width()#
- Return type:
float
Returns the inline object’s width.
See also