source: trunk/doc/html/qcanvastext.html@ 203

Last change on this file since 203 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/canvas/qcanvas.cpp:4858 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QCanvasText Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QCanvasText Class Reference<br><small>[<a href="canvas.html">canvas module</a>]</small></h1>
33
34<p>The QCanvasText class provides a text object on a QCanvas.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qcanvas-h.html">qcanvas.h</a>&gt;</tt>
37<p>Inherits <a href="qcanvasitem.html">QCanvasItem</a>.
38<p><a href="qcanvastext-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QCanvasText"><b>QCanvasText</b></a> ( QCanvas&nbsp;*&nbsp;canvas )</li>
42<li class=fn><a href="#QCanvasText-2"><b>QCanvasText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;t, QCanvas&nbsp;*&nbsp;canvas )</li>
43<li class=fn><a href="#QCanvasText-3"><b>QCanvasText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;t, QFont&nbsp;f, QCanvas&nbsp;*&nbsp;canvas )</li>
44<li class=fn>virtual <a href="#~QCanvasText"><b>~QCanvasText</b></a> ()</li>
45<li class=fn>void <a href="#setText"><b>setText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;t )</li>
46<li class=fn>void <a href="#setFont"><b>setFont</b></a> ( const&nbsp;QFont&nbsp;&amp;&nbsp;f )</li>
47<li class=fn>void <a href="#setColor"><b>setColor</b></a> ( const&nbsp;QColor&nbsp;&amp;&nbsp;c )</li>
48<li class=fn>QString <a href="#text"><b>text</b></a> () const</li>
49<li class=fn>QFont <a href="#font"><b>font</b></a> () const</li>
50<li class=fn>QColor <a href="#color"><b>color</b></a> () const</li>
51<li class=fn>int <a href="#textFlags"><b>textFlags</b></a> () const</li>
52<li class=fn>void <a href="#setTextFlags"><b>setTextFlags</b></a> ( int&nbsp;f )</li>
53<li class=fn>virtual QRect <a href="#boundingRect"><b>boundingRect</b></a> () const</li>
54<li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
55</ul>
56<h2>Protected Members</h2>
57<ul>
58<li class=fn>virtual void <a href="#draw"><b>draw</b></a> ( QPainter&nbsp;&amp;&nbsp;painter )</li>
59</ul>
60<hr><a name="details"></a><h2>Detailed Description</h2>
61
62
63The QCanvasText class provides a text object on a <a href="qcanvas.html">QCanvas</a>.
64
65<p>
66
67
68<p> A canvas text item has text with font, color and alignment
69attributes. The text and font can be set in the constructor or set
70or changed later with <a href="#setText">setText</a>() and <a href="#setFont">setFont</a>(). The color is set
71with <a href="#setColor">setColor</a>() and the alignment with <a href="#setTextFlags">setTextFlags</a>(). The text
72item's bounding rectangle is retrieved with <a href="#boundingRect">boundingRect</a>().
73<p> The text can be drawn on a painter with <a href="#draw">draw</a>().
74<p> Like any other canvas item text items can be moved with
75<a href="qcanvasitem.html#move">QCanvasItem::move</a>() and <a href="qcanvasitem.html#moveBy">QCanvasItem::moveBy</a>(), or by setting
76coordinates with <a href="qcanvasitem.html#setX">QCanvasItem::setX</a>(), <a href="qcanvasitem.html#setY">QCanvasItem::setY</a>() and
77<a href="qcanvasitem.html#setZ">QCanvasItem::setZ</a>().
78<p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.
79
80<hr><h2>Member Function Documentation</h2>
81<h3 class=fn><a name="QCanvasText"></a>QCanvasText::QCanvasText ( <a href="qcanvas.html">QCanvas</a>&nbsp;*&nbsp;canvas )
82</h3>
83Constructs a QCanvasText with the text "&lt;text&gt;", on <em>canvas</em>.
84
85<h3 class=fn><a name="QCanvasText-2"></a>QCanvasText::QCanvasText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;t, <a href="qcanvas.html">QCanvas</a>&nbsp;*&nbsp;canvas )
86</h3>
87Constructs a QCanvasText with the text <em>t</em>, on canvas <em>canvas</em>.
88
89<h3 class=fn><a name="QCanvasText-3"></a>QCanvasText::QCanvasText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;t, <a href="qfont.html">QFont</a>&nbsp;f, <a href="qcanvas.html">QCanvas</a>&nbsp;*&nbsp;canvas )
90</h3>
91Constructs a QCanvasText with the text <em>t</em> and font <em>f</em>, on the
92canvas <em>canvas</em>.
93
94<h3 class=fn><a name="~QCanvasText"></a>QCanvasText::~QCanvasText ()<tt> [virtual]</tt>
95</h3>
96Destroys the canvas text item.
97
98<h3 class=fn><a href="qrect.html">QRect</a> <a name="boundingRect"></a>QCanvasText::boundingRect () const<tt> [virtual]</tt>
99</h3>
100Returns the bounding rectangle of the text.
101
102<p>Reimplemented from <a href="qcanvasitem.html#boundingRect">QCanvasItem</a>.
103<h3 class=fn><a href="qcolor.html">QColor</a> <a name="color"></a>QCanvasText::color () const
104</h3>
105Returns the color of the text.
106<p> <p>See also <a href="#setColor">setColor</a>().
107
108<h3 class=fn>void <a name="draw"></a>QCanvasText::draw ( <a href="qpainter.html">QPainter</a>&nbsp;&amp;&nbsp;painter )<tt> [virtual protected]</tt>
109</h3>
110Draws the text using the painter <em>painter</em>.
111
112<p>Reimplemented from <a href="qcanvasitem.html#draw">QCanvasItem</a>.
113<h3 class=fn><a href="qfont.html">QFont</a> <a name="font"></a>QCanvasText::font () const
114</h3>
115Returns the font in which the text is drawn.
116<p> <p>See also <a href="#setFont">setFont</a>().
117
118<h3 class=fn>int <a name="rtti"></a>QCanvasText::rtti () const<tt> [virtual]</tt>
119</h3>
120Returns 3 (QCanvasItem::Rtti_Text).
121<p> <p>See also <a href="qcanvasitem.html#rtti">QCanvasItem::rtti</a>().
122
123<p>Reimplemented from <a href="qcanvasitem.html#rtti">QCanvasItem</a>.
124<h3 class=fn>void <a name="setColor"></a>QCanvasText::setColor ( const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;c )
125</h3>
126Sets the color of the text to the color <em>c</em>.
127<p> <p>See also <a href="#color">color</a>() and <a href="#setFont">setFont</a>().
128
129<p>Example: <a href="tutorial2-06.html#x2574">chart/chartform_canvas.cpp</a>.
130<h3 class=fn>void <a name="setFont"></a>QCanvasText::setFont ( const&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;f )
131</h3>
132Sets the font in which the text is drawn to font <em>f</em>.
133<p> <p>See also <a href="#font">font</a>().
134
135<h3 class=fn>void <a name="setText"></a>QCanvasText::setText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;t )
136</h3>
137Sets the text item's text to <em>t</em>. The text may contain newlines.
138<p> <p>See also <a href="#text">text</a>(), <a href="#setFont">setFont</a>(), <a href="#setColor">setColor</a>(), and <a href="#setTextFlags">setTextFlags</a>().
139
140<p>Example: <a href="canvas-example.html#x2929">canvas/canvas.cpp</a>.
141<h3 class=fn>void <a name="setTextFlags"></a>QCanvasText::setTextFlags ( int&nbsp;f )
142</h3>
143Sets the alignment flags to <em>f</em>. These are a bitwise OR of the
144flags available to <a href="qpainter.html#drawText">QPainter::drawText</a>() -- see the
145<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>.
146<p> <p>See also <a href="#setFont">setFont</a>() and <a href="#setColor">setColor</a>().
147
148<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QCanvasText::text () const
149</h3>
150Returns the text item's text.
151<p> <p>See also <a href="#setText">setText</a>().
152
153<h3 class=fn>int <a name="textFlags"></a>QCanvasText::textFlags () const
154</h3>
155
156<p> Returns the currently set alignment flags.
157<p> <p>See also <a href="#setTextFlags">setTextFlags</a>() and <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>.
158
159<!-- eof -->
160<hr><p>
161This file is part of the <a href="index.html">Qt toolkit</a>.
162Copyright &copy; 1995-2007
163<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
164<table width=100% cellspacing=0 border=0><tr>
165<td>Copyright &copy; 2007
166<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
167<td align=right><div align=right>Qt 3.3.8</div>
168</table></div></address></body>
169</html>
Note: See TracBrowser for help on using the repository browser.