QTextItem 類提供在自定義描繪引擎中描繪文本所需的所有信息。 更多...
| 頭: | #include <QTextItem> |
| qmake: | QT += gui |
| enum | RenderFlag { RightToLeft, Overline, Underline, StrikeOut } |
| flags | RenderFlags |
| qreal | ascent () const |
| qreal | descent () const |
| QFont | font () const |
| QTextItem::RenderFlags | renderFlags () const |
| QString | text () const |
| qreal | width () const |
When you reimplement your own paint engine, you must reimplement QPaintEngine::drawTextItem (), a function that takes a QTextItem as one of its arguments.
| 常量 | 值 | 描述 |
|---|---|---|
QTextItem::RightToLeft
|
0x1
|
Render the text from right to left. |
QTextItem::Overline
|
0x10
|
Paint a line above the text. |
QTextItem::Underline
|
0x20
|
Paint a line under the text. |
QTextItem::StrikeOut
|
0x40
|
Paint a line through the text. |
RenderFlags 類型是 typedef 對於 QFlags <RenderFlag>。它存儲 RenderFlag 值的 OR 組閤。
相當於 ascent of the piece of text that is drawn.
相當於 descent of the piece of text that is drawn.
Returns the font that should be used to draw the text.
Returns the render flags used.
Returns the text that should be drawn.
Specifies the total width of the text to be drawn.