QTextInlineObjectclass represents an inline object in aQAbstractTextDocumentLayout及其实现。 更多 …
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
()
Normally, you do not need to create a
QTextInlineObject. It is used byQAbstractTextDocumentLayoutto handle inline objects when implementing a custom layout.The inline object has various attributes that can be set, for example using,
setWidth(),setAscent(),和setDescent(). 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().
QTextInlineObject
¶
PySide2.QtGui.QTextInlineObject.
ascent
(
)
¶
qreal
Returns the inline object’s ascent.
PySide2.QtGui.QTextInlineObject.
descent
(
)
¶
qreal
Returns the inline object’s descent.
PySide2.QtGui.QTextInlineObject.
format
(
)
¶
Returns format of the inline object within the text layout.
PySide2.QtGui.QTextInlineObject.
formatIndex
(
)
¶
int
Returns an integer describing the format of the inline object within the text layout.
PySide2.QtGui.QTextInlineObject.
height
(
)
¶
qreal
Returns the inline object’s total height. This is equal to
ascent()
+
descent()
+ 1.
PySide2.QtGui.QTextInlineObject.
isValid
(
)
¶
bool
返回
true
if this inline object is valid; otherwise returns false.
PySide2.QtGui.QTextInlineObject.
rect
(
)
¶
QRectF
Returns the inline object’s rectangle.
PySide2.QtGui.QTextInlineObject.
setAscent
(
a
)
¶
a
–
qreal
Sets the inline object’s ascent to
a
.
PySide2.QtGui.QTextInlineObject.
setDescent
(
d
)
¶
d
–
qreal
Sets the inline object’s descent to
d
.
PySide2.QtGui.QTextInlineObject.
setWidth
(
w
)
¶
w
–
qreal
Sets the inline object’s width to
w
.
PySide2.QtGui.QTextInlineObject.
textDirection
(
)
¶
LayoutDirection
Returns if the object should be laid out right-to-left or left-to-right.
PySide2.QtGui.QTextInlineObject.
textPosition
(
)
¶
int
The position of the inline object within the text layout.
PySide2.QtGui.QTextInlineObject.
width
(
)
¶
qreal
Returns the inline object’s width.