'\" t .TH TQCanvasText 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 TQCanvasText \- Text object on a TQCanvas .SH SYNOPSIS \fC#include \fR .PP Inherits TQCanvasItem. .PP .SS "Public Members" .in +1c .ti -1c .BI "\fBTQCanvasText\fR ( TQCanvas * canvas )" .br .ti -1c .BI "\fBTQCanvasText\fR ( const TQString & t, TQCanvas * canvas )" .br .ti -1c .BI "\fBTQCanvasText\fR ( const TQString & t, TQFont f, TQCanvas * canvas )" .br .ti -1c .BI "virtual \fB~TQCanvasText\fR ()" .br .ti -1c .BI "void \fBsetText\fR ( const TQString & t )" .br .ti -1c .BI "void \fBsetFont\fR ( const TQFont & f )" .br .ti -1c .BI "void \fBsetColor\fR ( const TQColor & c )" .br .ti -1c .BI "TQString \fBtext\fR () const" .br .ti -1c .BI "TQFont \fBfont\fR () const" .br .ti -1c .BI "TQColor \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 TQRect \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 ( TQPainter & painter )" .br .in -1c .SH DESCRIPTION The TQCanvasText class provides a text object on a TQCanvas. .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 TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQCanvasText::TQCanvasText ( TQCanvas * canvas )" Constructs a TQCanvasText with the text "", on \fIcanvas\fR. .SH "TQCanvasText::TQCanvasText ( const TQString & t, TQCanvas * canvas )" Constructs a TQCanvasText with the text \fIt\fR, on canvas \fIcanvas\fR. .SH "TQCanvasText::TQCanvasText ( const TQString & t, TQFont f, TQCanvas * canvas )" Constructs a TQCanvasText with the text \fIt\fR and font \fIf\fR, on the canvas \fIcanvas\fR. .SH "TQCanvasText::~TQCanvasText ()\fC [virtual]\fR" Destroys the canvas text item. .SH "TQRect TQCanvasText::boundingRect () const\fC [virtual]\fR" Returns the bounding rectangle of the text. .PP Reimplemented from TQCanvasItem. .SH "TQColor TQCanvasText::color () const" Returns the color of the text. .PP See also setColor(). .SH "void TQCanvasText::draw ( TQPainter & painter )\fC [virtual protected]\fR" Draws the text using the painter \fIpainter\fR. .PP Reimplemented from TQCanvasItem. .SH "TQFont TQCanvasText::font () const" Returns the font in which the text is drawn. .PP See also setFont(). .SH "int TQCanvasText::rtti () const\fC [virtual]\fR" Returns 3 (TQCanvasItem::Rtti_Text). .PP See also TQCanvasItem::rtti(). .PP Reimplemented from TQCanvasItem. .SH "void TQCanvasText::setColor ( const TQColor & 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 TQCanvasText::setFont ( const TQFont & f )" Sets the font in which the text is drawn to font \fIf\fR. .PP See also font(). .SH "void TQCanvasText::setText ( const TQString & 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 TQCanvasText::setTextFlags ( int f )" Sets the alignment flags to \fIf\fR. These are a bitwise OR of the flags available to TQPainter::drawText() -- see the TQt::AlignmentFlags. .PP See also setFont() and setColor(). .SH "TQString TQCanvasText::text () const" Returns the text item's text. .PP See also setText(). .SH "int TQCanvasText::textFlags () const" Returns the currently set alignment flags. .PP See also setTextFlags() and TQt::AlignmentFlags. .SH "SEE ALSO" .BR http://doc.trolltech.com/tqcanvastext.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 $TQTDIR/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).