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