- class QTextInlineObject¶
The
QTextInlineObject
class represents an inline object in aQAbstractTextDocumentLayout
and its implementations. More…Synopsis¶
Methods¶
def
__init__()
def
ascent()
def
descent()
def
format()
def
formatIndex()
def
height()
def
isValid()
def
rect()
def
setAscent()
def
setDescent()
def
setWidth()
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 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()
.- __init__()¶
- ascent()¶
- Return type:
float
Returns the inline object’s ascent.
See also
- descent()¶
- Return type:
float
Returns the inline object’s descent.
See also
- format()¶
- Return type:
Returns format of the inline object within the text layout.
- formatIndex()¶
- Return type:
int
Returns an integer describing the format of the inline object within the text layout.
- height()¶
- Return type:
float
Returns the inline object’s total height. This is equal to
ascent()
+descent()
+ 1.- isValid()¶
- Return type:
bool
Returns
true
if this inline object is valid; otherwise returns false.Returns the inline object’s rectangle.
- setAscent(a)¶
- Parameters:
a – float
Sets the inline object’s ascent to
a
.See also
- setDescent(d)¶
- Parameters:
d – float
Sets the inline object’s descent to
d
.See also
- setWidth(w)¶
- Parameters:
w – float
Sets the inline object’s width to
w
.- textDirection()¶
- Return type:
Returns if the object should be laid out right-to-left or left-to-right.
- textPosition()¶
- Return type:
int
The position of the inline object within the text layout.
- width()¶
- Return type:
float
Returns the inline object’s width.
See also