QCanvasText(3qt)

NAME
QCanvasText - A text object on a

#include <qcanvas.h>

Inherits QCanvasItem.

  Public Members
QCanvasText ( QCanvas * canvas )
QCanvasText ( const QString &, QCanvas * canvas )
QCanvasText ( const QString &, QFont, QCanvas * canvas )
virtual ~QCanvasText ()
void setText ( const QString & )
void setFont ( const QFont & )
void setColor ( const QColor & )
QString text () const
QFont font () const
QColor color () const
int textFlags () const
void setTextFlags ( int )
virtual QRect boundingRect () const
virtual int rtti () const

  Protected Members
virtual void draw ( QPainter & )

DESCRIPTION
A text object on a QCanvas.

A QCanvasText has text, a font, color, and position.

MEMBER FUNCTION DOCUMENTATION

QCanvasText::QCanvasText ( QCanvas * canvas )
Constructs a QCanvasText with the text "<text>", on canvas.

QCanvasText::QCanvasText ( const QString & t, QCanvas * canvas )
Constructs a QCanvasText with the text t, on canvas.

The text should not contain newlines.

QCanvasText::QCanvasText ( const QString & t, QFont f, QCanvas * canvas )
Constructs a QCanvasText with the text t and font f, on canvas.

The text should not contain newlines.

QCanvasText::~QCanvasText () [virtual]
Destruct the sprite.

QRect QCanvasText::boundingRect () const [virtual]
Returns the bounding rectangle of the text.

Reimplemented from QCanvasItem.

bool QCanvasText::collidesWith ( const QCanvasItem * i ) const [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QCanvasItem.

QColor QCanvasText::color () const
Returns the color of the text.

See also setColor().

void QCanvasText::draw ( QPainter & painter ) [virtual protected]
Draws the text.

QFont QCanvasText::font () const
Returns the font in which the text is drawn.

See also setFont().

void QCanvasText::moveBy ( double dx, double dy ) [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QCanvasItem.

int QCanvasText::rtti () const [virtual]
Returns 3.

See also QCanvasItem::rtti().

void QCanvasText::setColor ( const QColor & c )
Sets the color of the text.

See also color() and setFont().

void QCanvasText::setFont ( const QFont & f )
Sets the font in which the text is drawn.

See also font().

void QCanvasText::setText ( const QString & t )
Sets the text to be displayed. The text may contain newlines.

See also text(), setFont() and setColor().

void QCanvasText::setTextFlags ( int f )
Sets the alignment flags. These are a bitwise OR or some of the flags available to QPainter::drawText() - see Qt::AlignmentFlags.

The DontClip and WordBreak flags are not supported.

QString QCanvasText::text () const
Returns the text to be displayed.

See also setText().

int QCanvasText::textFlags () const
Returns the currently set alignment flags.

See also setTextFlags() and Qt::AlignmentFlags.

SEE ALSO
http://doc.trolltech.com/qcanvastext.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcanvastext.3) and the Qt version (2.3.0).