'\" t
.TH QCanvasText 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QCanvasText \- Text object on a QCanvas
.SH SYNOPSIS
\fC#include <ntqcanvas.h>\fR
.PP
Inherits QCanvasItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQCanvasText\fR ( QCanvas * canvas )"
.br
.ti -1c
.BI "\fBQCanvasText\fR ( const QString & t, QCanvas * canvas )"
.br
.ti -1c
.BI "\fBQCanvasText\fR ( const QString & t, QFont f, QCanvas * canvas )"
.br
.ti -1c
.BI "virtual \fB~QCanvasText\fR ()"
.br
.ti -1c
.BI "void \fBsetText\fR ( const QString & t )"
.br
.ti -1c
.BI "void \fBsetFont\fR ( const QFont & f )"
.br
.ti -1c
.BI "void \fBsetColor\fR ( const QColor & c )"
.br
.ti -1c
.BI "QString \fBtext\fR () const"
.br
.ti -1c
.BI "QFont \fBfont\fR () const"
.br
.ti -1c
.BI "QColor \fBcolor\fR () const"
.br
.ti -1c
.BI "int \fBtextFlags\fR () const"
.br
.ti -1c
.BI "void \fBsetTextFlags\fR ( int f )"
.br
.ti -1c
.BI "virtual QRect \fBboundingRect\fR () const"
.br
.ti -1c
.BI "virtual int \fBrtti\fR () const"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBdraw\fR ( QPainter & painter )"
.br
.in -1c
.SH DESCRIPTION
The QCanvasText class provides a text object on a QCanvas.
.PP
A canvas text item has text with font, color and alignment attributes. The text and font can be set in the constructor or set or changed later with setText() and setFont(). The color is set with setColor() and the alignment with setTextFlags(). The text item's bounding rectangle is retrieved with boundingRect().
.PP
The text can be drawn on a painter with draw().
.PP
Like any other canvas item text items can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ().
.PP
See also Graphics Classes and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QCanvasText::QCanvasText ( QCanvas * canvas )"
Constructs a QCanvasText with the text "<text>", on \fIcanvas\fR.
.SH "QCanvasText::QCanvasText ( const QString & t, QCanvas * canvas )"
Constructs a QCanvasText with the text \fIt\fR, on canvas \fIcanvas\fR.
.SH "QCanvasText::QCanvasText ( const QString & t, QFont f, QCanvas * canvas )"
Constructs a QCanvasText with the text \fIt\fR and font \fIf\fR, on the canvas \fIcanvas\fR.
.SH "QCanvasText::~QCanvasText ()\fC [virtual]\fR"
Destroys the canvas text item.
.SH "QRect QCanvasText::boundingRect () const\fC [virtual]\fR"
Returns the bounding rectangle of the text.
.PP
Reimplemented from QCanvasItem.
.SH "QColor QCanvasText::color () const"
Returns the color of the text.
.PP
See also setColor().
.SH "void QCanvasText::draw ( QPainter & painter )\fC [virtual protected]\fR"
Draws the text using the painter \fIpainter\fR.
.PP
Reimplemented from QCanvasItem.
.SH "QFont QCanvasText::font () const"
Returns the font in which the text is drawn.
.PP
See also setFont().
.SH "int QCanvasText::rtti () const\fC [virtual]\fR"
Returns 3 (QCanvasItem::Rtti_Text).
.PP
See also QCanvasItem::rtti().
.PP
Reimplemented from QCanvasItem.
.SH "void QCanvasText::setColor ( const QColor & c )"
Sets the color of the text to the color \fIc\fR.
.PP
See also color() and setFont().
.PP
Example: chart/chartform_canvas.cpp.
.SH "void QCanvasText::setFont ( const QFont & f )"
Sets the font in which the text is drawn to font \fIf\fR.
.PP
See also font().
.SH "void QCanvasText::setText ( const QString & t )"
Sets the text item's text to \fIt\fR. The text may contain newlines.
.PP
See also text(), setFont(), setColor(), and setTextFlags().
.PP
Example: canvas/canvas.cpp.
.SH "void QCanvasText::setTextFlags ( int f )"
Sets the alignment flags to \fIf\fR. These are a bitwise OR of the flags available to QPainter::drawText() -- see the Qt::AlignmentFlags.
.PP
See also setFont() and setColor().
.SH "QString QCanvasText::text () const"
Returns the text item's text.
.PP
See also setText().
.SH "int QCanvasText::textFlags () const"
Returns the currently set alignment flags.
.PP
See also setTextFlags() and Qt::AlignmentFlags.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcanvastext.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqcanvastext.3qt) and the Qt
version (3.3.8).