QTextItem Class
The QTextItem class provides all the information required to draw text in a custom paint engine. More...
Header: | #include <QTextItem> |
qmake: | QT += gui |
Public Types
enum | RenderFlag { RightToLeft, Overline, Underline, StrikeOut } |
flags | RenderFlags |
Public Functions
qreal | ascent() const |
qreal | descent() const |
QFont | font() const |
QTextItem::RenderFlags | renderFlags() const |
QString | text() const |
qreal | width() const |
Detailed Description
The QTextItem class provides all the information required to draw text in a custom paint engine.
When you reimplement your own paint engine, you must reimplement QPaintEngine::drawTextItem(), a function that takes a QTextItem as one of its arguments.
Member Type Documentation
enum QTextItem::RenderFlag
flags QTextItem::RenderFlags
Constant | Value | Description |
---|---|---|
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. |
The RenderFlags type is a typedef for QFlags<RenderFlag>. It stores an OR combination of RenderFlag values.