Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

QwtPlainText Class Reference

Inheritance diagram for QwtPlainText:

Inheritance graph
[legend]
Collaboration diagram for QwtPlainText:

Collaboration graph
[legend]
List of all members.

Detailed Description

Plain text drawing support.

Definition at line 127 of file qwt_text.h.

Public Member Functions

 QwtPlainText (const QString &text, const QFont &, int flags=Qt::AlignCenter|Qt::ExpandTabs|Qt::WordBreak, const QColor &color=QColor(), const QPen &pen=QPen(Qt::NoPen), const QBrush &brush=QBrush(Qt::NoBrush))
 QwtPlainText (const QString &text, const QFont &font, const QColor &color)
virtual QwtTextclone () const
virtual int heightForWidth (int width) const
virtual QRect boundingRect (QPainter *painter=0) const
virtual void draw (QPainter *painter, const QRect &rect) const


Constructor & Destructor Documentation

QwtPlainText::QwtPlainText const QString &  text,
const QFont &  font,
int  flags = Qt::AlignCenter | Qt::ExpandTabs | Qt::WordBreak,
const QColor &  color = QColor(),
const QPen &  pen = QPen(Qt::NoPen),
const QBrush &  brush = QBrush(Qt::NoBrush)
 

Constructor.

Parameters:
text Contents of the text
font Font of the text
flags Or'd values of Qt::AlignmentFlags or Qt::TextFlags
color Color of the text
pen Pen to draw the enclosing rectangle
brush Brush to draw the enclosing rectangle

Definition at line 271 of file qwt_text.cpp.

Referenced by clone().

QwtPlainText::QwtPlainText const QString &  text,
const QFont &  font,
const QColor &  color
 

Constructor.

Parameters:
text Text
font Font
color Color

Definition at line 284 of file qwt_text.cpp.


Member Function Documentation

QRect QwtPlainText::boundingRect QPainter *  painter = 0  )  const [virtual]
 

Returns the bounding rectangle.

The bounding rectangle is calculated with respect to (0, 0). The left and top border depend on the flags:

  • the left border is at -width, -width/2 or 0 for Qt::AlignRight, Qt::AlignHCenter or Qt::AlignLeft respectively
  • the top border is at 0, -height/2 or -height for Qt::AlignTop, Qt::AlignVCenter or Qt::AlignBottom respectively

Use for instance QRect::moveBy(x,y), before drawing the text into the rectangle.

Implements QwtText.

Definition at line 334 of file qwt_text.cpp.

References QwtText::boundingRect(), QwtText::flags(), QwtText::font(), QwtText::fontMetrics(), QwtText::setFont(), and QwtText::text().

QwtText * QwtPlainText::clone  )  const [virtual]
 

Create a clone.

Implements QwtText.

Definition at line 297 of file qwt_text.cpp.

References QwtText::color(), QwtText::flags(), QwtText::font(), QwtPlainText(), QwtText::rectBrush(), QwtText::rectPen(), and QwtText::text().

void QwtPlainText::draw QPainter *  painter,
const QRect &  rect
const [virtual]
 

Draw the text in a clipping rectangle.

Parameters:
painter Painter
rect Clipping rectangle

Implements QwtText.

Definition at line 319 of file qwt_text.cpp.

References QwtText::color(), QwtPainter::drawRect(), QwtPainter::drawText(), QwtText::flags(), QwtText::font(), QwtText::rectBrush(), QwtText::rectPen(), QwtText::setFont(), and QwtText::text().

int QwtPlainText::heightForWidth int  width  )  const [virtual]
 

Find the height for a given width.

Parameters:
width Width
Returns:
height Height

Implements QwtText.

Definition at line 308 of file qwt_text.cpp.

References QwtText::flags(), QwtText::fontMetrics(), QwtText::heightForWidth(), and QwtText::text().


Generated on Wed Aug 31 23:03:34 2005 for Qwt User's Guide by  doxygen 1.4.1