Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QTextItem Class Reference

\inmodule QtGui More...

#include <qpaintengine.h>

+ Inheritance diagram for QTextItem:
+ Collaboration diagram for QTextItem:

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.
 

Detailed Description

\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.

Member Enumeration Documentation

◆ RenderFlag

\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.

Member Function Documentation

◆ ascent()

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().

+ Here is the call graph for this function:

◆ descent()

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().

+ Here is the call graph for this function:

◆ font()

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().

+ Here is the call graph for this function:

◆ renderFlags()

QTextItem::RenderFlags QTextItem::renderFlags ( ) const

Returns the render flags used.

Definition at line 84 of file qpaintengine.cpp.

References QTextItemInt::flags.

◆ text()

QString QTextItem::text ( ) const

Returns the text that should be drawn.

Definition at line 95 of file qpaintengine.cpp.

◆ width()

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.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: