QTextInlineObject¶
The
QTextInlineObject
class represents an inline object in aQAbstractTextDocumentLayout
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
()
Detailed Description¶
Normally, you do not need to create a
QTextInlineObject
. It is used byQAbstractTextDocumentLayout
to handle inline objects when implementing a custom layout.The inline object has various attributes that can be set, for example using,
setWidth()
,setAscent()
, andsetDescent()
. The rectangle it occupies is given byrect()
, and its direction bytextDirection()
. Its position in the text layout is given bytextPosition()
, and its format is given byformat()
.
- class PySide2.QtGui.QTextInlineObject¶
- PySide2.QtGui.QTextInlineObject.ascent()¶
- Return type:
float
Returns the inline object’s ascent.
See also
- PySide2.QtGui.QTextInlineObject.descent()¶
- Return type:
float
Returns the inline object’s descent.
See also
- PySide2.QtGui.QTextInlineObject.format()¶
- Return type:
Returns format of the inline object within the text layout.
- PySide2.QtGui.QTextInlineObject.formatIndex()¶
- Return type:
int
Returns an integer describing the format of the inline object within the text layout.
- PySide2.QtGui.QTextInlineObject.height()¶
- Return type:
float
Returns the inline object’s total height. This is equal to
ascent()
+descent()
+ 1.
- PySide2.QtGui.QTextInlineObject.isValid()¶
- Return type:
bool
Returns
true
if this inline object is valid; otherwise returns false.
- PySide2.QtGui.QTextInlineObject.rect()¶
- Return type:
Returns the inline object’s rectangle.
- PySide2.QtGui.QTextInlineObject.setAscent(a)¶
- Parameters:
a – float
Sets the inline object’s ascent to
a
.See also
- PySide2.QtGui.QTextInlineObject.setDescent(d)¶
- Parameters:
d – float
Sets the inline object’s descent to
d
.See also
- PySide2.QtGui.QTextInlineObject.setWidth(w)¶
- Parameters:
w – float
Sets the inline object’s width to
w
.
- PySide2.QtGui.QTextInlineObject.textDirection()¶
- Return type:
Returns if the object should be laid out right-to-left or left-to-right.
- PySide2.QtGui.QTextInlineObject.textPosition()¶
- Return type:
int
The position of the inline object within the text layout.
- PySide2.QtGui.QTextInlineObject.width()¶
- Return type:
float
Returns the inline object’s width.
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.