source: trunk/doc/html/qcanvasellipse.html@ 208

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

reference documentation added

File size: 8.5 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:4671 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QCanvasEllipse 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>QCanvasEllipse Class Reference<br><small>[<a href="canvas.html">canvas module</a>]</small></h1>
33
34<p>The QCanvasEllipse class provides an ellipse or ellipse segment 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="qcanvaspolygonalitem.html">QCanvasPolygonalItem</a>.
38<p><a href="qcanvasellipse-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QCanvasEllipse"><b>QCanvasEllipse</b></a> ( QCanvas&nbsp;*&nbsp;canvas )</li>
42<li class=fn><a href="#QCanvasEllipse-2"><b>QCanvasEllipse</b></a> ( int&nbsp;width, int&nbsp;height, QCanvas&nbsp;*&nbsp;canvas )</li>
43<li class=fn><a href="#QCanvasEllipse-3"><b>QCanvasEllipse</b></a> ( int&nbsp;width, int&nbsp;height, int&nbsp;startangle, int&nbsp;angle, QCanvas&nbsp;*&nbsp;canvas )</li>
44<li class=fn><a href="#~QCanvasEllipse"><b>~QCanvasEllipse</b></a> ()</li>
45<li class=fn>int <a href="#width"><b>width</b></a> () const</li>
46<li class=fn>int <a href="#height"><b>height</b></a> () const</li>
47<li class=fn>void <a href="#setSize"><b>setSize</b></a> ( int&nbsp;width, int&nbsp;height )</li>
48<li class=fn>void <a href="#setAngles"><b>setAngles</b></a> ( int&nbsp;start, int&nbsp;length )</li>
49<li class=fn>int <a href="#angleStart"><b>angleStart</b></a> () const</li>
50<li class=fn>int <a href="#angleLength"><b>angleLength</b></a> () const</li>
51<li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
52</ul>
53<h2>Protected Members</h2>
54<ul>
55<li class=fn>virtual void <a href="#drawShape"><b>drawShape</b></a> ( QPainter&nbsp;&amp;&nbsp;p )</li>
56</ul>
57<hr><a name="details"></a><h2>Detailed Description</h2>
58
59
60The QCanvasEllipse class provides an ellipse or ellipse segment on a <a href="qcanvas.html">QCanvas</a>.
61
62<p>
63
64
65<p> A canvas item that paints an ellipse or ellipse segment with a <a href="qbrush.html">QBrush</a>.
66The ellipse's height, width, start angle and angle length can be set
67at construction time. The size can be changed at runtime with
68<a href="#setSize">setSize</a>(), and the angles can be changed (if you're displaying an
69ellipse segment rather than a whole ellipse) with <a href="#setAngles">setAngles</a>().
70<p> Note that angles are specified in 16ths of a degree.
71<p> <a name="anglediagram"></a>
72<center><img src="qcanvasellipse.png" alt="Ellipse"></center>
73<p> If a start angle and length angle are set then an ellipse segment
74will be drawn. The start angle is the angle that goes from zero in a
75counter-clockwise direction (shown in green in the diagram). The
76length angle is the angle from the start angle in a
77counter-clockwise direction (shown in blue in the diagram). The blue
78segment is the segment of the ellipse that would be drawn. If no
79start angle and length angle are specified the entire ellipse is
80drawn.
81<p> The ellipse can be drawn on a painter with <a href="#drawShape">drawShape</a>().
82<p> Like any other canvas item ellipses can be moved with <a href="qcanvasitem.html#move">move</a>() and
83<a href="qcanvasitem.html#moveBy">moveBy</a>(), or by setting coordinates with <a href="qcanvasitem.html#setX">setX</a>(), <a href="qcanvasitem.html#setY">setY</a>() and <a href="qcanvasitem.html#setZ">setZ</a>().
84<p> Note: QCanvasEllipse does not use the pen.
85<p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.
86
87<hr><h2>Member Function Documentation</h2>
88<h3 class=fn><a name="QCanvasEllipse"></a>QCanvasEllipse::QCanvasEllipse ( <a href="qcanvas.html">QCanvas</a>&nbsp;*&nbsp;canvas )
89</h3>
90Constructs a 32x32 ellipse, centered at (0, 0) on <em>canvas</em>.
91
92<h3 class=fn><a name="QCanvasEllipse-2"></a>QCanvasEllipse::QCanvasEllipse ( int&nbsp;width, int&nbsp;height, <a href="qcanvas.html">QCanvas</a>&nbsp;*&nbsp;canvas )
93</h3>
94Constructs a <em>width</em> by <em>height</em> pixel ellipse, centered at
95(0, 0) on <em>canvas</em>.
96
97<h3 class=fn><a name="QCanvasEllipse-3"></a>QCanvasEllipse::QCanvasEllipse ( int&nbsp;width, int&nbsp;height, int&nbsp;startangle, int&nbsp;angle, <a href="qcanvas.html">QCanvas</a>&nbsp;*&nbsp;canvas )
98</h3>
99Constructs a <em>width</em> by <em>height</em> pixel ellipse, centered at
100(0, 0) on <em>canvas</em>. Only a segment of the ellipse is drawn,
101starting at angle <em>startangle</em>, and extending for angle <em>angle</em>
102(the angle length).
103<p> Note that angles are specified in
104<small><sup>1</sup>/<sub>16</sub></small>ths of a degree.
105
106<h3 class=fn><a name="~QCanvasEllipse"></a>QCanvasEllipse::~QCanvasEllipse ()
107</h3>
108Destroys the ellipse.
109
110<h3 class=fn>int <a name="angleLength"></a>QCanvasEllipse::angleLength () const
111</h3>
112
113<p> Returns the length angle (the extent of the ellipse segment) in
11416ths of a degree. Initially this will be 360 * 16 (a complete
115ellipse).
116<p> <p>See also <a href="#setAngles">setAngles</a>() and <a href="#angleStart">angleStart</a>().
117
118<h3 class=fn>int <a name="angleStart"></a>QCanvasEllipse::angleStart () const
119</h3>
120
121<p> Returns the start angle in 16ths of a degree. Initially
122this will be 0.
123<p> <p>See also <a href="#setAngles">setAngles</a>() and <a href="#angleLength">angleLength</a>().
124
125<h3 class=fn>void <a name="drawShape"></a>QCanvasEllipse::drawShape ( <a href="qpainter.html">QPainter</a>&nbsp;&amp;&nbsp;p )<tt> [virtual protected]</tt>
126</h3>
127Draws the ellipse, centered at <a href="qcanvasitem.html#x">x</a>(), <a href="qcanvasitem.html#y">y</a>() using the painter <em>p</em>.
128<p> Note that QCanvasEllipse does not support an outline (the pen is
129always NoPen).
130
131<p>Reimplemented from <a href="qcanvaspolygonalitem.html#drawShape">QCanvasPolygonalItem</a>.
132<h3 class=fn>int <a name="height"></a>QCanvasEllipse::height () const
133</h3>
134Returns the height of the ellipse.
135
136<h3 class=fn>int <a name="rtti"></a>QCanvasEllipse::rtti () const<tt> [virtual]</tt>
137</h3>
138Returns 6 (QCanvasItem::Rtti_Ellipse).
139<p> <p>See also <a href="qcanvasitem.html#rtti">QCanvasItem::rtti</a>().
140
141<p>Reimplemented from <a href="qcanvaspolygonalitem.html#rtti">QCanvasPolygonalItem</a>.
142<h3 class=fn>void <a name="setAngles"></a>QCanvasEllipse::setAngles ( int&nbsp;start, int&nbsp;length )
143</h3>
144Sets the angles for the ellipse. The start angle is <em>start</em> and
145the extent of the segment is <em>length</em> (the angle length) from the
146<em>start</em>. The angles are specified in 16ths of a degree. By
147default the ellipse will start at 0 and have an angle length of
148360 * 16 (a complete ellipse).
149<p> <p>See also <a href="#angleStart">angleStart</a>() and <a href="#angleLength">angleLength</a>().
150
151<h3 class=fn>void <a name="setSize"></a>QCanvasEllipse::setSize ( int&nbsp;width, int&nbsp;height )
152</h3>
153Sets the <em>width</em> and <em>height</em> of the ellipse.
154
155<h3 class=fn>int <a name="width"></a>QCanvasEllipse::width () const
156</h3>
157Returns the width of the ellipse.
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.