QtBase  v6.3.1
Public Types | Public Member Functions | List of all members
QTextItem Class Reference

The QTextItem class provides all the information required to draw text in a custom paint engine. More...

#include <qpaintengine.h>

Inheritance diagram for QTextItem:
Inheritance graph
[legend]

Public Types

enum  RenderFlag {
  RightToLeft = 0x1 , Overline = 0x10 , Underline = 0x20 , StrikeOut = 0x40 ,
  Dummy = 0xffffffff
}
 

Public Member Functions

qreal descent () const
 
qreal ascent () const
 
qreal width () const
 
RenderFlags renderFlags () const
 
QString text () const
 
QFont font () const
 

Detailed Description

The QTextItem class provides all the information required to draw text in a custom paint engine.

\inmodule QtGui

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 64 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 66 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 98 of file qpaintengine.cpp.

Here is the call graph for this function:
Here is the caller 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 87 of file qpaintengine.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ font()

QFont QTextItem::font ( ) const

Returns the font that should be used to draw the text.

Definition at line 142 of file qpaintengine.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderFlags()

QTextItem::RenderFlags QTextItem::renderFlags ( ) const

Returns the render flags used.

Definition at line 120 of file qpaintengine.cpp.

Here is the caller graph for this function:

◆ text()

QString QTextItem::text ( ) const

Returns the text that should be drawn.

Definition at line 131 of file qpaintengine.cpp.

Here is the caller graph for this function:

◆ width()

qreal QTextItem::width ( ) const

Specifies the total width of the text to be drawn.

Definition at line 109 of file qpaintengine.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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