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/kernel/qregion.cpp:44 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QRegion 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>QRegion Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QRegion class specifies a clip region for a painter.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qregion-h.html">qregion.h</a>></tt>
|
---|
37 | <p><a href="qregion-members.html">List of all member functions.</a>
|
---|
38 | <h2>Public Members</h2>
|
---|
39 | <ul>
|
---|
40 | <li class=fn>enum <a href="#RegionType-enum"><b>RegionType</b></a> { Rectangle, Ellipse }</li>
|
---|
41 | <li class=fn><a href="#QRegion"><b>QRegion</b></a> ()</li>
|
---|
42 | <li class=fn><a href="#QRegion-2"><b>QRegion</b></a> ( int x, int y, int w, int h, RegionType t = Rectangle )</li>
|
---|
43 | <li class=fn><a href="#QRegion-3"><b>QRegion</b></a> ( const QRect & r, RegionType t = Rectangle )</li>
|
---|
44 | <li class=fn><a href="#QRegion-4"><b>QRegion</b></a> ( const QPointArray & a, bool winding = FALSE )</li>
|
---|
45 | <li class=fn><a href="#QRegion-5"><b>QRegion</b></a> ( const QRegion & r )</li>
|
---|
46 | <li class=fn><a href="#QRegion-6"><b>QRegion</b></a> ( const QBitmap & bm )</li>
|
---|
47 | <li class=fn><a href="#~QRegion"><b>~QRegion</b></a> ()</li>
|
---|
48 | <li class=fn>QRegion & <a href="#operator-eq"><b>operator=</b></a> ( const QRegion & r )</li>
|
---|
49 | <li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
|
---|
50 | <li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
|
---|
51 | <li class=fn>bool <a href="#contains"><b>contains</b></a> ( const QPoint & p ) const</li>
|
---|
52 | <li class=fn>bool <a href="#contains-2"><b>contains</b></a> ( const QRect & r ) const</li>
|
---|
53 | <li class=fn>void <a href="#translate"><b>translate</b></a> ( int dx, int dy )</li>
|
---|
54 | <li class=fn>QRegion <a href="#unite"><b>unite</b></a> ( const QRegion & r ) const</li>
|
---|
55 | <li class=fn>QRegion <a href="#intersect"><b>intersect</b></a> ( const QRegion & r ) const</li>
|
---|
56 | <li class=fn>QRegion <a href="#subtract"><b>subtract</b></a> ( const QRegion & r ) const</li>
|
---|
57 | <li class=fn>QRegion <a href="#eor"><b>eor</b></a> ( const QRegion & r ) const</li>
|
---|
58 | <li class=fn>QRect <a href="#boundingRect"><b>boundingRect</b></a> () const</li>
|
---|
59 | <li class=fn>QMemArray<QRect> <a href="#rects"><b>rects</b></a> () const</li>
|
---|
60 | <li class=fn>const QRegion <a href="#operator|"><b>operator|</b></a> ( const QRegion & r ) const</li>
|
---|
61 | <li class=fn>const QRegion <a href="#operator+"><b>operator+</b></a> ( const QRegion & r ) const</li>
|
---|
62 | <li class=fn>const QRegion <a href="#operator-and"><b>operator&</b></a> ( const QRegion & r ) const</li>
|
---|
63 | <li class=fn>const QRegion <a href="#operator-"><b>operator-</b></a> ( const QRegion & r ) const</li>
|
---|
64 | <li class=fn>const QRegion <a href="#operator^"><b>operator^</b></a> ( const QRegion & r ) const</li>
|
---|
65 | <li class=fn>QRegion & <a href="#operator|-eq"><b>operator|=</b></a> ( const QRegion & r )</li>
|
---|
66 | <li class=fn>QRegion & <a href="#operator+-eq"><b>operator+=</b></a> ( const QRegion & r )</li>
|
---|
67 | <li class=fn>QRegion & <a href="#operator-and-eq"><b>operator&=</b></a> ( const QRegion & r )</li>
|
---|
68 | <li class=fn>QRegion & <a href="#operator--eq"><b>operator-=</b></a> ( const QRegion & r )</li>
|
---|
69 | <li class=fn>QRegion & <a href="#operator^-eq"><b>operator^=</b></a> ( const QRegion & r )</li>
|
---|
70 | <li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QRegion & r ) const</li>
|
---|
71 | <li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const QRegion & r ) const</li>
|
---|
72 | <li class=fn>HRGN <a href="#handle"><b>handle</b></a> () const</li>
|
---|
73 | </ul>
|
---|
74 | <h2>Related Functions</h2>
|
---|
75 | <ul>
|
---|
76 | <li class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QRegion & r )</li>
|
---|
77 | <li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QRegion & r )</li>
|
---|
78 | </ul>
|
---|
79 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
80 |
|
---|
81 |
|
---|
82 | The QRegion class specifies a clip region for a painter.
|
---|
83 | <p>
|
---|
84 |
|
---|
85 | <p> QRegion is used with <a href="qpainter.html#setClipRegion">QPainter::setClipRegion</a>() to limit the paint
|
---|
86 | area to what needs to be painted. There is also a
|
---|
87 | <a href="qwidget.html#repaint">QWidget::repaint</a>() that takes a QRegion parameter. QRegion is the
|
---|
88 | best tool for reducing flicker.
|
---|
89 | <p> A region can be created from a rectangle, an ellipse, a polygon or
|
---|
90 | a bitmap. Complex regions may be created by combining simple
|
---|
91 | regions using <a href="#unite">unite</a>(), <a href="#intersect">intersect</a>(), <a href="#subtract">subtract</a>() or <a href="#eor">eor</a>() (exclusive
|
---|
92 | or). You can move a region using <a href="#translate">translate</a>().
|
---|
93 | <p> You can test whether a region <a href="#isNull">isNull</a>(), <a href="#isEmpty">isEmpty</a>() or if it
|
---|
94 | <a href="#contains">contains</a>() a <a href="qpoint.html">QPoint</a> or <a href="qrect.html">QRect</a>. The bounding rectangle is given by
|
---|
95 | <a href="#boundingRect">boundingRect</a>().
|
---|
96 | <p> The function <a href="#rects">rects</a>() gives a decomposition of the region into
|
---|
97 | rectangles.
|
---|
98 | <p> Example of using complex regions:
|
---|
99 | <pre>
|
---|
100 | void MyWidget::paintEvent( <a href="qpaintevent.html">QPaintEvent</a> * )
|
---|
101 | {
|
---|
102 | <a href="qpainter.html">QPainter</a> p; // our painter
|
---|
103 | QRegion r1( QRect(100,100,200,80), // r1 = elliptic region
|
---|
104 | QRegion::<a href="#RegionType-enum">Ellipse</a> );
|
---|
105 | QRegion r2( QRect(100,120,90,30) ); // r2 = rectangular region
|
---|
106 | QRegion r3 = r1.<a href="#intersect">intersect</a>( r2 ); // r3 = intersection
|
---|
107 | p.<a href="qpainter.html#begin">begin</a>( this ); // start painting widget
|
---|
108 | p.<a href="qpainter.html#setClipRegion">setClipRegion</a>( r3 ); // set clip region
|
---|
109 | ... // paint clipped graphics
|
---|
110 | p.<a href="qpainter.html#end">end</a>(); // painting done
|
---|
111 | }
|
---|
112 | </pre>
|
---|
113 |
|
---|
114 | <p> QRegion is an <a href="shclass.html">implicitly shared</a> class.
|
---|
115 | <p> <b>Warning:</b> Due to window system limitations, the whole coordinate
|
---|
116 | space for a region is limited to the points between -32767 and
|
---|
117 | 32767 on Mac OS X and Windows 95/98/ME.
|
---|
118 | <p> <p>See also <a href="qpainter.html#setClipRegion">QPainter::setClipRegion</a>(), <a href="qpainter.html#setClipRect">QPainter::setClipRect</a>(), <a href="graphics.html">Graphics Classes</a>, and <a href="images.html">Image Processing Classes</a>.
|
---|
119 |
|
---|
120 | <hr><h2>Member Type Documentation</h2>
|
---|
121 | <h3 class=fn><a name="RegionType-enum"></a>QRegion::RegionType</h3>
|
---|
122 |
|
---|
123 | <p> Specifies the shape of the region to be created.
|
---|
124 | <ul>
|
---|
125 | <li><tt>QRegion::Rectangle</tt> - the region covers the entire rectangle.
|
---|
126 | <li><tt>QRegion::Ellipse</tt> - the region is an ellipse inside the rectangle.
|
---|
127 | </ul>
|
---|
128 | <hr><h2>Member Function Documentation</h2>
|
---|
129 | <h3 class=fn><a name="QRegion"></a>QRegion::QRegion ()
|
---|
130 | </h3>
|
---|
131 | Constructs a null region.
|
---|
132 | <p> <p>See also <a href="#isNull">isNull</a>().
|
---|
133 |
|
---|
134 | <h3 class=fn><a name="QRegion-2"></a>QRegion::QRegion ( int x, int y, int w, int h, <a href="qregion.html#RegionType-enum">RegionType</a> t = Rectangle )
|
---|
135 | </h3>
|
---|
136 | Constructs a rectangular or elliptic region.
|
---|
137 | <p> If <em>t</em> is <a href="#RegionType-enum">Rectangle</a>, the region is the filled rectangle (<em>x</em>,
|
---|
138 | <em>y</em>, <em>w</em>, <em>h</em>). If <em>t</em> is <a href="#RegionType-enum">Ellipse</a>, the region is the filled
|
---|
139 | ellipse with center at (<em>x</em> + <em>w</em> / 2, <em>y</em> + <em>h</em> / 2) and size
|
---|
140 | (<em>w</em> ,<em>h</em> ).
|
---|
141 |
|
---|
142 | <h3 class=fn><a name="QRegion-3"></a>QRegion::QRegion ( const <a href="qrect.html">QRect</a> & r, <a href="qregion.html#RegionType-enum">RegionType</a> t = Rectangle )
|
---|
143 | </h3>
|
---|
144 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
145 | <p> Create a region based on the rectange <em>r</em> with region type <em>t</em>.
|
---|
146 | <p> If the rectangle is invalid a null region will be created.
|
---|
147 | <p> <p>See also <a href="#RegionType-enum">QRegion::RegionType</a>.
|
---|
148 |
|
---|
149 | <h3 class=fn><a name="QRegion-4"></a>QRegion::QRegion ( const <a href="qpointarray.html">QPointArray</a> & a, bool winding = FALSE )
|
---|
150 | </h3>
|
---|
151 | Constructs a polygon region from the point array <em>a</em>.
|
---|
152 | <p> If <em>winding</em> is TRUE, the polygon region is filled using the
|
---|
153 | winding algorithm, otherwise the default even-odd fill algorithm
|
---|
154 | is used.
|
---|
155 | <p> This constructor may create complex regions that will slow down
|
---|
156 | painting when used.
|
---|
157 |
|
---|
158 | <h3 class=fn><a name="QRegion-5"></a>QRegion::QRegion ( const <a href="qregion.html">QRegion</a> & r )
|
---|
159 | </h3>
|
---|
160 | Constructs a new region which is equal to region <em>r</em>.
|
---|
161 |
|
---|
162 | <h3 class=fn><a name="QRegion-6"></a>QRegion::QRegion ( const <a href="qbitmap.html">QBitmap</a> & bm )
|
---|
163 | </h3>
|
---|
164 | Constructs a region from the bitmap <em>bm</em>.
|
---|
165 | <p> The resulting region consists of the pixels in bitmap <em>bm</em> that
|
---|
166 | are <tt>color1</tt>, as if each pixel was a 1 by 1 rectangle.
|
---|
167 | <p> This constructor may create complex regions that will slow down
|
---|
168 | painting when used. Note that drawing masked pixmaps can be done
|
---|
169 | much faster using <a href="qpixmap.html#setMask">QPixmap::setMask</a>().
|
---|
170 |
|
---|
171 | <h3 class=fn><a name="~QRegion"></a>QRegion::~QRegion ()
|
---|
172 | </h3>
|
---|
173 | Destroys the region.
|
---|
174 |
|
---|
175 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="boundingRect"></a>QRegion::boundingRect () const
|
---|
176 | </h3>
|
---|
177 | Returns the bounding rectangle of this region. An empty region
|
---|
178 | gives a rectangle that is <a href="qrect.html#isNull">QRect::isNull</a>().
|
---|
179 |
|
---|
180 | <h3 class=fn>bool <a name="contains"></a>QRegion::contains ( const <a href="qpoint.html">QPoint</a> & p ) const
|
---|
181 | </h3>
|
---|
182 | Returns TRUE if the region contains the point <em>p</em>; otherwise
|
---|
183 | returns FALSE.
|
---|
184 |
|
---|
185 | <h3 class=fn>bool <a name="contains-2"></a>QRegion::contains ( const <a href="qrect.html">QRect</a> & r ) const
|
---|
186 | </h3>
|
---|
187 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
188 | <p> Returns TRUE if the region overlaps the rectangle <em>r</em>; otherwise
|
---|
189 | returns FALSE.
|
---|
190 |
|
---|
191 | <h3 class=fn><a href="qregion.html">QRegion</a> <a name="eor"></a>QRegion::eor ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
192 | </h3>
|
---|
193 | Returns a region which is the exclusive or (XOR) of this region
|
---|
194 | and <em>r</em>.
|
---|
195 | <p> <center><img src="rxor.png" alt="Region XORed"></center>
|
---|
196 | <p> The figure shows the exclusive or of two elliptical regions.
|
---|
197 |
|
---|
198 | <h3 class=fn>HRGN <a name="handle"></a>QRegion::handle () const
|
---|
199 | </h3>
|
---|
200 |
|
---|
201 | <p> Returns the region's handle.
|
---|
202 |
|
---|
203 | <h3 class=fn><a href="qregion.html">QRegion</a> <a name="intersect"></a>QRegion::intersect ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
204 | </h3>
|
---|
205 | Returns a region which is the intersection of this region and <em>r</em>.
|
---|
206 | <p> <center><img src="rintersect.png" alt="Region Intersection"></center>
|
---|
207 | <p> The figure shows the intersection of two elliptical regions.
|
---|
208 |
|
---|
209 | <h3 class=fn>bool <a name="isEmpty"></a>QRegion::isEmpty () const
|
---|
210 | </h3>
|
---|
211 | Returns TRUE if the region is empty; otherwise returns FALSE. An
|
---|
212 | empty region is a region that contains no points.
|
---|
213 | <p> Example:
|
---|
214 | <pre>
|
---|
215 | QRegion r1( 10, 10, 20, 20 );
|
---|
216 | QRegion r2( 40, 40, 20, 20 );
|
---|
217 | QRegion r3;
|
---|
218 | r1.<a href="#isNull">isNull</a>(); // FALSE
|
---|
219 | r1.<a href="#isEmpty">isEmpty</a>(); // FALSE
|
---|
220 | r3.<a href="#isNull">isNull</a>(); // TRUE
|
---|
221 | r3.<a href="#isEmpty">isEmpty</a>(); // TRUE
|
---|
222 | r3 = r1.<a href="#intersect">intersect</a>( r2 ); // r3 = intersection of r1 and r2
|
---|
223 | r3.<a href="#isNull">isNull</a>(); // FALSE
|
---|
224 | r3.<a href="#isEmpty">isEmpty</a>(); // TRUE
|
---|
225 | r3 = r1.<a href="#unite">unite</a>( r2 ); // r3 = union of r1 and r2
|
---|
226 | r3.<a href="#isNull">isNull</a>(); // FALSE
|
---|
227 | r3.<a href="#isEmpty">isEmpty</a>(); // FALSE
|
---|
228 | </pre>
|
---|
229 |
|
---|
230 | <p> <p>See also <a href="#isNull">isNull</a>().
|
---|
231 |
|
---|
232 | <h3 class=fn>bool <a name="isNull"></a>QRegion::isNull () const
|
---|
233 | </h3>
|
---|
234 | Returns TRUE if the region is a null region; otherwise returns
|
---|
235 | FALSE.
|
---|
236 | <p> A null region is a region that has not been initialized. A null
|
---|
237 | region is always empty.
|
---|
238 | <p> <p>See also <a href="#isEmpty">isEmpty</a>().
|
---|
239 |
|
---|
240 | <h3 class=fn>bool <a name="operator!-eq"></a>QRegion::operator!= ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
241 | </h3>
|
---|
242 |
|
---|
243 | <p> Returns TRUE if the region is different from <em>r</em>; otherwise
|
---|
244 | returns FALSE.
|
---|
245 |
|
---|
246 | <h3 class=fn>const <a href="qregion.html">QRegion</a> <a name="operator-and"></a>QRegion::operator& ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
247 | </h3>
|
---|
248 | Applies the <a href="#intersect">intersect</a>() function to this region and <em>r</em>. <tt>r1&r2</tt>
|
---|
249 | is equivalent to <tt>r1.intersect(r2)</tt>
|
---|
250 | <p> <p>See also <a href="#intersect">intersect</a>().
|
---|
251 |
|
---|
252 | <h3 class=fn><a href="qregion.html">QRegion</a> & <a name="operator-and-eq"></a>QRegion::operator&= ( const <a href="qregion.html">QRegion</a> & r )
|
---|
253 | </h3>
|
---|
254 | Applies the <a href="#intersect">intersect</a>() function to this region and <em>r</em> and
|
---|
255 | assigns the result to this region. <tt>r1&=r2</tt> is equivalent to <tt>r1=r1.intersect(r2)</tt>
|
---|
256 | <p> <p>See also <a href="#intersect">intersect</a>().
|
---|
257 |
|
---|
258 | <h3 class=fn>const <a href="qregion.html">QRegion</a> <a name="operator+"></a>QRegion::operator+ ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
259 | </h3>
|
---|
260 | Applies the <a href="#unite">unite</a>() function to this region and <em>r</em>. <tt>r1+r2</tt> is
|
---|
261 | equivalent to <tt>r1.unite(r2)</tt>
|
---|
262 | <p> <p>See also <a href="#unite">unite</a>() and <a href="#operator|">operator|</a>().
|
---|
263 |
|
---|
264 | <h3 class=fn><a href="qregion.html">QRegion</a> & <a name="operator+-eq"></a>QRegion::operator+= ( const <a href="qregion.html">QRegion</a> & r )
|
---|
265 | </h3>
|
---|
266 | Applies the <a href="#unite">unite</a>() function to this region and <em>r</em> and assigns
|
---|
267 | the result to this region. <tt>r1+=r2</tt> is equivalent to <tt>r1=r1.unite(r2)</tt>
|
---|
268 | <p> <p>See also <a href="#intersect">intersect</a>().
|
---|
269 |
|
---|
270 | <h3 class=fn>const <a href="qregion.html">QRegion</a> <a name="operator-"></a>QRegion::operator- ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
271 | </h3>
|
---|
272 | Applies the <a href="#subtract">subtract</a>() function to this region and <em>r</em>. <tt>r1-r2</tt>
|
---|
273 | is equivalent to <tt>r1.subtract(r2)</tt>
|
---|
274 | <p> <p>See also <a href="#subtract">subtract</a>().
|
---|
275 |
|
---|
276 | <h3 class=fn><a href="qregion.html">QRegion</a> & <a name="operator--eq"></a>QRegion::operator-= ( const <a href="qregion.html">QRegion</a> & r )
|
---|
277 | </h3>
|
---|
278 | Applies the <a href="#subtract">subtract</a>() function to this region and <em>r</em> and
|
---|
279 | assigns the result to this region. <tt>r1-=r2</tt> is equivalent to <tt>r1=r1.subtract(r2)</tt>
|
---|
280 | <p> <p>See also <a href="#subtract">subtract</a>().
|
---|
281 |
|
---|
282 | <h3 class=fn><a href="qregion.html">QRegion</a> & <a name="operator-eq"></a>QRegion::operator= ( const <a href="qregion.html">QRegion</a> & r )
|
---|
283 | </h3>
|
---|
284 | Assigns <em>r</em> to this region and returns a reference to the region.
|
---|
285 |
|
---|
286 | <h3 class=fn>bool <a name="operator-eq-eq"></a>QRegion::operator== ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
287 | </h3>
|
---|
288 | Returns TRUE if the region is equal to <em>r</em>; otherwise returns
|
---|
289 | FALSE.
|
---|
290 |
|
---|
291 | <h3 class=fn>const <a href="qregion.html">QRegion</a> <a name="operator^"></a>QRegion::operator^ ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
292 | </h3>
|
---|
293 | Applies the <a href="#eor">eor</a>() function to this region and <em>r</em>. <tt>r1^r2</tt> is
|
---|
294 | equivalent to <tt>r1.eor(r2)</tt>
|
---|
295 | <p> <p>See also <a href="#eor">eor</a>().
|
---|
296 |
|
---|
297 | <h3 class=fn><a href="qregion.html">QRegion</a> & <a name="operator^-eq"></a>QRegion::operator^= ( const <a href="qregion.html">QRegion</a> & r )
|
---|
298 | </h3>
|
---|
299 | Applies the <a href="#eor">eor</a>() function to this region and <em>r</em> and
|
---|
300 | assigns the result to this region. <tt>r1^=r2</tt> is equivalent to <tt>r1=r1.eor(r2)</tt>
|
---|
301 | <p> <p>See also <a href="#eor">eor</a>().
|
---|
302 |
|
---|
303 | <h3 class=fn>const <a href="qregion.html">QRegion</a> <a name="operator|"></a>QRegion::operator| ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
304 | </h3>
|
---|
305 | Applies the <a href="#unite">unite</a>() function to this region and <em>r</em>. <tt>r1|r2</tt> is
|
---|
306 | equivalent to <tt>r1.unite(r2)</tt>
|
---|
307 | <p> <p>See also <a href="#unite">unite</a>() and <a href="#operator+">operator+</a>().
|
---|
308 |
|
---|
309 | <h3 class=fn><a href="qregion.html">QRegion</a> & <a name="operator|-eq"></a>QRegion::operator|= ( const <a href="qregion.html">QRegion</a> & r )
|
---|
310 | </h3>
|
---|
311 | Applies the <a href="#unite">unite</a>() function to this region and <em>r</em> and assigns
|
---|
312 | the result to this region. <tt>r1|=r2</tt> is equivalent to <tt>r1=r1.unite(r2)</tt>
|
---|
313 | <p> <p>See also <a href="#unite">unite</a>().
|
---|
314 |
|
---|
315 | <h3 class=fn><a href="qmemarray.html">QMemArray</a><QRect> <a name="rects"></a>QRegion::rects () const
|
---|
316 | </h3>
|
---|
317 | Returns an array of non-overlapping rectangles that make up the
|
---|
318 | region.
|
---|
319 | <p> The union of all the rectangles is equal to the original region.
|
---|
320 |
|
---|
321 | <h3 class=fn><a href="qregion.html">QRegion</a> <a name="subtract"></a>QRegion::subtract ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
322 | </h3>
|
---|
323 | Returns a region which is <em>r</em> subtracted from this region.
|
---|
324 | <p> <center><img src="rsubtract.png" alt="Region Subtraction"></center>
|
---|
325 | <p> The figure shows the result when the ellipse on the right is
|
---|
326 | subtracted from the ellipse on the left. (<tt>left-right</tt> )
|
---|
327 |
|
---|
328 | <h3 class=fn>void <a name="translate"></a>QRegion::translate ( int dx, int dy )
|
---|
329 | </h3>
|
---|
330 | Translates (moves) the region <em>dx</em> along the X axis and <em>dy</em>
|
---|
331 | along the Y axis.
|
---|
332 |
|
---|
333 | <h3 class=fn><a href="qregion.html">QRegion</a> <a name="unite"></a>QRegion::unite ( const <a href="qregion.html">QRegion</a> & r ) const
|
---|
334 | </h3>
|
---|
335 | Returns a region which is the union of this region and <em>r</em>.
|
---|
336 | <p> <center><img src="runion.png" alt="Region Union"></center>
|
---|
337 | <p> The figure shows the union of two elliptical regions.
|
---|
338 |
|
---|
339 | <hr><h2>Related Functions</h2>
|
---|
340 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-lt-lt"></a>operator<< ( <a href="qdatastream.html">QDataStream</a> & s, const <a href="qregion.html">QRegion</a> & r )
|
---|
341 | </h3>
|
---|
342 |
|
---|
343 | <p> Writes the region <em>r</em> to the stream <em>s</em> and returns a reference
|
---|
344 | to the stream.
|
---|
345 | <p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
346 |
|
---|
347 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qdatastream.html">QDataStream</a> & s, <a href="qregion.html">QRegion</a> & r )
|
---|
348 | </h3>
|
---|
349 |
|
---|
350 | <p> Reads a region from the stream <em>s</em> into <em>r</em> and returns a
|
---|
351 | reference to the stream.
|
---|
352 | <p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
353 |
|
---|
354 | <!-- eof -->
|
---|
355 | <hr><p>
|
---|
356 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
357 | Copyright © 1995-2007
|
---|
358 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
359 | <table width=100% cellspacing=0 border=0><tr>
|
---|
360 | <td>Copyright © 2007
|
---|
361 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
362 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
363 | </table></div></address></body>
|
---|
364 | </html>
|
---|