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:4533 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QCanvasRectangle Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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>QCanvasRectangle Class Reference<br><small>[<a href="canvas.html">canvas module</a>]</small></h1>
|
---|
33 |
|
---|
34 | <p>The QCanvasRectangle class provides a rectangle on a QCanvas.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qcanvas-h.html">qcanvas.h</a>></tt>
|
---|
37 | <p>Inherits <a href="qcanvaspolygonalitem.html">QCanvasPolygonalItem</a>.
|
---|
38 | <p><a href="qcanvasrectangle-members.html">List of all member functions.</a>
|
---|
39 | <h2>Public Members</h2>
|
---|
40 | <ul>
|
---|
41 | <li class=fn><a href="#QCanvasRectangle"><b>QCanvasRectangle</b></a> ( QCanvas * canvas )</li>
|
---|
42 | <li class=fn><a href="#QCanvasRectangle-2"><b>QCanvasRectangle</b></a> ( const QRect & r, QCanvas * canvas )</li>
|
---|
43 | <li class=fn><a href="#QCanvasRectangle-3"><b>QCanvasRectangle</b></a> ( int x, int y, int width, int height, QCanvas * canvas )</li>
|
---|
44 | <li class=fn><a href="#~QCanvasRectangle"><b>~QCanvasRectangle</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 width, int height )</li>
|
---|
48 | <li class=fn>QSize <a href="#size"><b>size</b></a> () const</li>
|
---|
49 | <li class=fn>QRect <a href="#rect"><b>rect</b></a> () const</li>
|
---|
50 | <li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
|
---|
51 | </ul>
|
---|
52 | <h2>Protected Members</h2>
|
---|
53 | <ul>
|
---|
54 | <li class=fn>virtual void <a href="#drawShape"><b>drawShape</b></a> ( QPainter & p )</li>
|
---|
55 | <li class=fn>virtual QPointArray <a href="#chunks"><b>chunks</b></a> () const</li>
|
---|
56 | </ul>
|
---|
57 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
58 |
|
---|
59 |
|
---|
60 | The QCanvasRectangle class provides a rectangle on a <a href="qcanvas.html">QCanvas</a>.
|
---|
61 |
|
---|
62 | <p>
|
---|
63 |
|
---|
64 |
|
---|
65 | <p> This item paints a single rectangle which may have any <a href="qcanvaspolygonalitem.html#pen">pen</a>() and
|
---|
66 | <a href="qcanvaspolygonalitem.html#brush">brush</a>(), but may not be tilted/rotated. For rotated rectangles,
|
---|
67 | use <a href="qcanvaspolygon.html">QCanvasPolygon</a>.
|
---|
68 | <p> The rectangle's size and initial position can be set in the
|
---|
69 | constructor. The size can be set or changed later using <a href="#setSize">setSize</a>().
|
---|
70 | Use <a href="#height">height</a>() and <a href="#width">width</a>() to retrieve the rectangle's dimensions.
|
---|
71 | <p> The rectangle can be drawn on a painter with <a href="#drawShape">drawShape</a>().
|
---|
72 | <p> Like any other canvas item rectangles can be moved with
|
---|
73 | <a href="qcanvasitem.html#move">QCanvasItem::move</a>() and <a href="qcanvasitem.html#moveBy">QCanvasItem::moveBy</a>(), or by setting
|
---|
74 | coordinates with <a href="qcanvasitem.html#setX">QCanvasItem::setX</a>(), <a href="qcanvasitem.html#setY">QCanvasItem::setY</a>() and
|
---|
75 | <a href="qcanvasitem.html#setZ">QCanvasItem::setZ</a>().
|
---|
76 | <p> <p>See also <a href="graphics.html">Graphics Classes</a> and <a href="images.html">Image Processing Classes</a>.
|
---|
77 |
|
---|
78 | <hr><h2>Member Function Documentation</h2>
|
---|
79 | <h3 class=fn><a name="QCanvasRectangle"></a>QCanvasRectangle::QCanvasRectangle ( <a href="qcanvas.html">QCanvas</a> * canvas )
|
---|
80 | </h3>
|
---|
81 | Constructs a rectangle at position (0,0) with both width and
|
---|
82 | height set to 32 pixels on <em>canvas</em>.
|
---|
83 |
|
---|
84 | <h3 class=fn><a name="QCanvasRectangle-2"></a>QCanvasRectangle::QCanvasRectangle ( const <a href="qrect.html">QRect</a> & r, <a href="qcanvas.html">QCanvas</a> * canvas )
|
---|
85 | </h3>
|
---|
86 | Constructs a rectangle positioned and sized by <em>r</em> on <em>canvas</em>.
|
---|
87 |
|
---|
88 | <h3 class=fn><a name="QCanvasRectangle-3"></a>QCanvasRectangle::QCanvasRectangle ( int x, int y, int width, int height, <a href="qcanvas.html">QCanvas</a> * canvas )
|
---|
89 | </h3>
|
---|
90 | Constructs a rectangle at position (<em>x</em>, <em>y</em>) and size <em>width</em>
|
---|
91 | by <em>height</em>, on <em>canvas</em>.
|
---|
92 |
|
---|
93 | <h3 class=fn><a name="~QCanvasRectangle"></a>QCanvasRectangle::~QCanvasRectangle ()
|
---|
94 | </h3>
|
---|
95 | Destroys the rectangle.
|
---|
96 |
|
---|
97 | <h3 class=fn><a href="qpointarray.html">QPointArray</a> <a name="chunks"></a>QCanvasRectangle::chunks () const<tt> [virtual protected]</tt>
|
---|
98 | </h3>
|
---|
99 | Simply calls QCanvasItem::chunks().
|
---|
100 |
|
---|
101 | <h3 class=fn>void <a name="drawShape"></a>QCanvasRectangle::drawShape ( <a href="qpainter.html">QPainter</a> & p )<tt> [virtual protected]</tt>
|
---|
102 | </h3>
|
---|
103 | Draws the rectangle on painter <em>p</em>.
|
---|
104 |
|
---|
105 | <p>Example: <a href="canvas-example.html#x2925">canvas/canvas.cpp</a>.
|
---|
106 | <p>Reimplemented from <a href="qcanvaspolygonalitem.html#drawShape">QCanvasPolygonalItem</a>.
|
---|
107 | <h3 class=fn>int <a name="height"></a>QCanvasRectangle::height () const
|
---|
108 | </h3>
|
---|
109 | Returns the height of the rectangle.
|
---|
110 |
|
---|
111 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="rect"></a>QCanvasRectangle::rect () const
|
---|
112 | </h3>
|
---|
113 |
|
---|
114 | <p> Returns the integer-converted <a href="qcanvasitem.html#x">x</a>(), <a href="qcanvasitem.html#y">y</a>() position and <a href="#size">size</a>() of the
|
---|
115 | rectangle as a <a href="qrect.html">QRect</a>.
|
---|
116 |
|
---|
117 | <h3 class=fn>int <a name="rtti"></a>QCanvasRectangle::rtti () const<tt> [virtual]</tt>
|
---|
118 | </h3>
|
---|
119 | Returns 5 (QCanvasItem::Rtti_Rectangle).
|
---|
120 | <p> <p>See also <a href="qcanvasitem.html#rtti">QCanvasItem::rtti</a>().
|
---|
121 |
|
---|
122 | <p>Reimplemented from <a href="qcanvaspolygonalitem.html#rtti">QCanvasPolygonalItem</a>.
|
---|
123 | <h3 class=fn>void <a name="setSize"></a>QCanvasRectangle::setSize ( int width, int height )
|
---|
124 | </h3>
|
---|
125 | Sets the <em>width</em> and <em>height</em> of the rectangle.
|
---|
126 |
|
---|
127 | <h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QCanvasRectangle::size () const
|
---|
128 | </h3>
|
---|
129 |
|
---|
130 | <p> Returns the <a href="#width">width</a>() and <a href="#height">height</a>() of the rectangle.
|
---|
131 | <p> <p>See also <a href="#rect">rect</a>() and <a href="#setSize">setSize</a>().
|
---|
132 |
|
---|
133 | <h3 class=fn>int <a name="width"></a>QCanvasRectangle::width () const
|
---|
134 | </h3>
|
---|
135 | Returns the width of the rectangle.
|
---|
136 |
|
---|
137 | <!-- eof -->
|
---|
138 | <hr><p>
|
---|
139 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
140 | Copyright © 1995-2007
|
---|
141 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
142 | <table width=100% cellspacing=0 border=0><tr>
|
---|
143 | <td>Copyright © 2007
|
---|
144 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
145 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
146 | </table></div></address></body>
|
---|
147 | </html>
|
---|