![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qpaintengine.h>
Public Types | |
enum | RenderFlag { RightToLeft = 0x1 , Overline = 0x10 , Underline = 0x20 , StrikeOut = 0x40 , Dummy = 0xffffffff } |
\value RightToLeft Render the text from right to left. More... | |
Public Member Functions | |
qreal | descent () const |
Corresponds to the \l{QFontMetrics::descent()}{descent} of the piece of text that is drawn. | |
qreal | ascent () const |
Corresponds to the \l{QFontMetrics::ascent()}{ascent} of the piece of text that is drawn. | |
qreal | width () const |
Specifies the total width of the text to be drawn. | |
RenderFlags | renderFlags () const |
Returns the render flags used. | |
QString | text () const |
Returns the text that should be drawn. | |
QFont | font () const |
Returns the font that should be used to draw the text. | |
\inmodule QtGui
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.
Definition at line 28 of file qpaintengine.h.
\value RightToLeft Render the text from right to left.
\value Overline Paint a line above the text. \value Underline Paint a line under the text. \value StrikeOut Paint a line through the text. \omitvalue Dummy
Enumerator | |
---|---|
RightToLeft | |
Overline | |
Underline | |
StrikeOut | |
Dummy |
Definition at line 30 of file qpaintengine.h.
qreal QTextItem::ascent | ( | ) | const |
Corresponds to the \l{QFontMetrics::ascent()}{ascent} of the piece of text that is drawn.
Definition at line 62 of file qpaintengine.cpp.
References QTextItemInt::ascent, and QFixed::toReal().
Referenced by QAlphaPaintEngine::drawTextItem(), and QPicturePaintEngine::drawTextItem().
qreal QTextItem::descent | ( | ) | const |
Corresponds to the \l{QFontMetrics::descent()}{descent} of the piece of text that is drawn.
Definition at line 51 of file qpaintengine.cpp.
References QTextItemInt::descent, and QFixed::toReal().
Referenced by QAlphaPaintEngine::drawTextItem().
QFont QTextItem::font | ( | ) | const |
Returns the font that should be used to draw the text.
Definition at line 106 of file qpaintengine.cpp.
References QTextItemInt::f, and QGuiApplication::font().
Referenced by QPicturePaintEngine::drawTextItem(), QSvgPaintEngine::drawTextItem(), and QBlittablePlatformPixmap::markRasterOverlay().
QTextItem::RenderFlags QTextItem::renderFlags | ( | ) | const |
Returns the render flags used.
Definition at line 84 of file qpaintengine.cpp.
References QTextItemInt::flags.
Referenced by QPicturePaintEngine::drawTextItem().
QString QTextItem::text | ( | ) | const |
Returns the text that should be drawn.
Definition at line 95 of file qpaintengine.cpp.
References QTextItemInt::chars, and QTextItemInt::num_chars.
Referenced by QPainterPrivate::drawTextItem(), QPicturePaintEngine::drawTextItem(), and QBlittablePlatformPixmap::markRasterOverlay().
qreal QTextItem::width | ( | ) | const |
Specifies the total width of the text to be drawn.
Definition at line 73 of file qpaintengine.cpp.
References QFixed::toReal(), and QTextItemInt::width.
Referenced by QAlphaPaintEngine::drawTextItem().