<class name="QRegion" doc="/**
&lt;p&gt;The &lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt; class specifies a clip region for a painter.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt; is used with QPainter::setClipRegion() to limit the paint area to what needs to be painted. There is also a QWidget::repaint() function that takes a &lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt; parameter. &lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt; is the best tool for reducing flicker.&lt;/p&gt;
&lt;p&gt;A region can be created from a rectangle, an ellipse, a polygon or a bitmap. Complex regions may be created by combining simple regions using &lt;a href=&quot;QRegion.html#united(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;united&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QRegion.html#intersected(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;intersected&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QRegion.html#subtracted(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;subtracted&lt;/tt&gt;&lt;/a&gt;, or &lt;a href=&quot;QRegion.html#xored(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;xored&lt;/tt&gt;&lt;/a&gt; (exclusive or). You can move a region using &lt;a href=&quot;QRegion.html#translate(int, int)&quot;&gt;&lt;tt&gt;translate&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can test whether a region &lt;a href=&quot;QRegion.html#isEmpty()&quot;&gt;&lt;tt&gt;isEmpty&lt;/tt&gt;&lt;/a&gt; or if it &lt;a href=&quot;QRegion.html#contains(com.trolltech.qt.core.QPoint)&quot;&gt;&lt;tt&gt;contains&lt;/tt&gt;&lt;/a&gt; a &lt;a href=&quot;%2E%2E/core/QPoint.html&quot;&gt;&lt;tt&gt;QPoint&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;%2E%2E/core/QRect.html&quot;&gt;&lt;tt&gt;QRect&lt;/tt&gt;&lt;/a&gt;. The bounding rectangle can be found with &lt;a href=&quot;QRegion.html#boundingRect()&quot;&gt;&lt;tt&gt;boundingRect&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The function &lt;a href=&quot;QRegion.html#rects()&quot;&gt;&lt;tt&gt;rects&lt;/tt&gt;&lt;/a&gt; gives a decomposition of the region into rectangles.&lt;/p&gt;
&lt;p&gt;Example of using complex regions:&lt;/p&gt;
&lt;pre&gt;    void MyWidget::paintEvent(QPaintEvent *)
    {
        QRegion r1(QRect(100, 100, 200, 80),    &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; r1: elliptic region
                   QRegion::Ellipse);
        QRegion r2(QRect(100, 120, 90, 30));    &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; r2: rectangular region
        QRegion r3 = r1.intersected(r2);        &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; r3: intersection

        QPainter painter(this);
        painter.setClipRegion(r3);
        ...                                     &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; paint clipped graphics
    }&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt; is an implicitly shared class&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; Due to window system limitations, the whole coordinate space for a region is limited to the points between -32767 and 32767 on Windows 95/98/ME. You can circumvent this limitation by using a &lt;a href=&quot;QPainterPath.html&quot;&gt;&lt;tt&gt;QPainterPath&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;a name=&quot;additional-license-information&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Additional License Information&lt;/h3&gt;
&lt;p&gt;For Qt/X11 and Qtopia Core, parts of this class rely on code obtained under the following license:&lt;/p&gt;
&lt;div style=&quot;padding: 0.5em; background: #e0e0e0; color: black&quot;&gt;&lt;p&gt;Copyright (c) 1987 X Consortium&lt;/p&gt;
&lt;p&gt;Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:&lt;/p&gt;
&lt;p&gt;The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.&lt;/p&gt;
&lt;p&gt;THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;/p&gt;
&lt;p&gt;Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.&lt;/p&gt;
&lt;/div&gt;    &lt;hr /&gt;
    &lt;div style=&quot;padding: 0.5em; background: #e0e0e0; color: black&quot;&gt;&lt;p&gt;Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.&lt;/p&gt;
&lt;p&gt;All Rights Reserved&lt;/p&gt;
&lt;p&gt;Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.&lt;/p&gt;
&lt;p&gt;DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.&lt;/p&gt;
&lt;/div&gt;
@see &lt;tt&gt;QPainter::setClipRegion&lt;/tt&gt;
@see &lt;tt&gt;QPainter::setClipRect&lt;/tt&gt;
@see &lt;a href=&quot;QPainterPath.html&quot;&gt;&lt;tt&gt;QPainterPath&lt;/tt&gt;&lt;/a&gt; */">
    <method name="public QRegion(com.trolltech.qt.gui.QBitmap bitmap)" doc="/**
&lt;p&gt;Constructs a region from the bitmap &lt;tt&gt;bitmap&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The resulting region consists of the pixels in bitmap &lt;tt&gt;bitmap&lt;/tt&gt; that are Qt::color1, as if each pixel was a 1 by 1 rectangle.&lt;/p&gt;
&lt;p&gt;This constructor may create complex regions that will slow down painting when used. Note that drawing masked pixmaps can be done much faster using QPixmap::setMask().&lt;/p&gt;
 */"/>
    <method name="public QRegion(com.trolltech.qt.gui.QPolygon pa, com.trolltech.qt.core.Qt.FillRule fillRule)" doc="/**
&lt;p&gt;Constructs a polygon region from the point array &lt;tt&gt;pa&lt;/tt&gt; with the fill rule specified by &lt;tt&gt;fillRule&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;fillRule&lt;/tt&gt; is &lt;tt&gt;Qt::WindingFill&lt;/tt&gt;, the polygon region is defined using the winding algorithm; if it is &lt;tt&gt;Qt::OddEvenFill&lt;/tt&gt;, the odd-even fill algorithm is used.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; This constructor can be used to create complex regions that will slow down painting when used.&lt;/p&gt;
 */"/>
    <method name="public QRegion(com.trolltech.qt.gui.QPolygon pa)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;pa&lt;/tt&gt;, Qt::OddEvenFill). */"/>
    <method name="public QRegion(int x, int y, int w, int h, com.trolltech.qt.gui.QRegion.RegionType t)" doc="/**
&lt;p&gt;Constructs a rectangular or elliptic region.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;t&lt;/tt&gt; is &lt;tt&gt;Rectangle&lt;/tt&gt;, the region is the filled rectangle (&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;, &lt;tt&gt;w&lt;/tt&gt;, &lt;tt&gt;h&lt;/tt&gt;). If &lt;tt&gt;t&lt;/tt&gt; is &lt;tt&gt;Ellipse&lt;/tt&gt;, the region is the filled ellipse with center at (&lt;tt&gt;x&lt;/tt&gt; + &lt;tt&gt;w&lt;/tt&gt; / 2, &lt;tt&gt;y&lt;/tt&gt; + &lt;tt&gt;h&lt;/tt&gt; / 2) and size (&lt;tt&gt;w&lt;/tt&gt; ,&lt;tt&gt;h&lt;/tt&gt;).&lt;/p&gt;
 */"/>
    <method name="public QRegion(int x, int y, int w, int h)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;x&lt;/tt&gt;, &lt;tt&gt;y&lt;/tt&gt;, &lt;tt&gt;w&lt;/tt&gt;, &lt;tt&gt;h&lt;/tt&gt;, Rectangle). */"/>
    <method name="public QRegion()" doc="/**
&lt;p&gt;Constructs an empty region.&lt;/p&gt;

@see &lt;a href=&quot;QRegion.html#isEmpty()&quot;&gt;&lt;tt&gt;isEmpty&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public QRegion(com.trolltech.qt.gui.QRegion region)" doc="/**
&lt;p&gt;Constructs a new region which is equal to region &lt;tt&gt;region&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public QRegion(com.trolltech.qt.core.QRect r, com.trolltech.qt.gui.QRegion.RegionType t)" doc="/**
&lt;p&gt;Create a region based on the rectange &lt;tt&gt;r&lt;/tt&gt; with region type &lt;tt&gt;t&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If the rectangle is invalid a null region will be created.&lt;/p&gt;

@see &lt;tt&gt;QRegion::RegionType&lt;/tt&gt; */"/>
    <method name="public QRegion(com.trolltech.qt.core.QRect r)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QRegion.html#QRegion(com.trolltech.qt.core.QRect, com.trolltech.qt.gui.QRegion.RegionType)&quot;&gt;&lt;tt&gt;QRegion&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;r&lt;/tt&gt;, Rectangle). */"/>
    <method name="public final com.trolltech.qt.core.QRect boundingRect()" doc="/**
&lt;p&gt;Returns the bounding rectangle of this region. An empty region gives a rectangle that is QRect::isNull().&lt;/p&gt;
 */"/>
    <method name="public final boolean contains(com.trolltech.qt.core.QRect r)" doc="/**
&lt;p&gt;Returns true if the region overlaps the rectangle &lt;tt&gt;r&lt;/tt&gt;; otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final boolean contains(com.trolltech.qt.core.QPoint p)" doc="/**
&lt;p&gt;Returns true if the region contains the point &lt;tt&gt;p&lt;/tt&gt;; otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QRegion intersected(com.trolltech.qt.gui.QRegion r)" doc="/**
&lt;p&gt;Returns a region which is the intersection of this region and &lt;tt&gt;r&lt;/tt&gt;.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;%2E%2E/images/rintersect.png&quot; alt=&quot;Region Intersection&quot; /&gt;&lt;/p&gt;&lt;p&gt;The figure shows the intersection of two elliptical regions.&lt;/p&gt;
 */"/>
    <method name="public final boolean intersects(com.trolltech.qt.core.QRect r)" doc="/**
&lt;p&gt;Returns true if this region intersects with &lt;tt&gt;r&lt;/tt&gt;, otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final boolean intersects(com.trolltech.qt.gui.QRegion r)" doc="/**
&lt;p&gt;Returns true if this region intersects with &lt;tt&gt;r&lt;/tt&gt;, otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final boolean isEmpty()" doc="/**
&lt;p&gt;Returns true if the region is empty; otherwise returns false. An empty region is a region that contains no points.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;    QRegion r1(10, 10, 20, 20);
    r1.isNull();                &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; false
    r1.isEmpty();               &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; false

    QRegion r2(40, 40, 20, 20);
    QRegion r3;
    r3.isNull();                &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; true
    r3.isEmpty();               &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; true

    r3 = r1.intersected(r2);    &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; r3: intersection of r1 and r2
    r3.isNull();                &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; false
    r3.isEmpty();               &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; true

    r3 = r1.united(r2);         &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; r3: union of r1 and r2
    r3.isNull();                &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; false
    r3.isEmpty();               &lt;span class=&quot;comment&quot;&gt;//&lt;/span&gt; false&lt;/pre&gt;
 */"/>
    <method name="public final void writeTo(com.trolltech.qt.core.QDataStream arg__1)"/>
    <method name="public final void readFrom(com.trolltech.qt.core.QDataStream arg__1)"/>
    <method name="public final java.util.List&lt;com.trolltech.qt.core.QRect&gt; rects()" doc="/**
&lt;p&gt;Returns an array of non-overlapping rectangles that make up the region.&lt;/p&gt;
&lt;p&gt;The union of all the rectangles is equal to the original region.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QRegion subtracted(com.trolltech.qt.gui.QRegion r)" doc="/**
&lt;p&gt;Returns a region which is &lt;tt&gt;r&lt;/tt&gt; subtracted from this region.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;%2E%2E/images/rsubtract.png&quot; alt=&quot;Region Subtraction&quot; /&gt;&lt;/p&gt;&lt;p&gt;The figure shows the result when the ellipse on the right is subtracted from the ellipse on the left (&lt;tt&gt;left - right&lt;/tt&gt;).&lt;/p&gt;

@see &lt;a href=&quot;QRegion.html#intersected(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;intersected&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QRegion.html#united(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;united&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QRegion.html#xored(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;xored&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void translate(com.trolltech.qt.core.QPoint p)" doc="/**
&lt;p&gt;Translates the region &lt;tt&gt;p&lt;/tt&gt;&lt;i&gt;.x()&lt;/i&gt; along the x axis and &lt;tt&gt;p&lt;/tt&gt;&lt;i&gt;.y()&lt;/i&gt; along the y axis, relative to the current position. Positive values move the region to the right and down.&lt;/p&gt;
&lt;p&gt;Translates to the given &lt;tt&gt;p&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final void translate(int dx, int dy)" doc="/**
&lt;p&gt;Translates (moves) the region &lt;tt&gt;dx&lt;/tt&gt; along the X axis and &lt;tt&gt;dy&lt;/tt&gt; along the Y axis.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QRegion translated(int dx, int dy)" doc="/**
&lt;p&gt;Returns a copy of the region that is translated &lt;tt&gt;dx&lt;/tt&gt; along the x axis and &lt;tt&gt;dy&lt;/tt&gt; along the y axis, relative to the current position. Positive values move the region to the right and down.&lt;/p&gt;

@see &lt;a href=&quot;QRegion.html#translate(int, int)&quot;&gt;&lt;tt&gt;translate&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QRegion translated(com.trolltech.qt.core.QPoint p)" doc="/**
&lt;p&gt;Returns a copy of the regtion that is translated &lt;tt&gt;p&lt;/tt&gt;&lt;i&gt;.x()&lt;/i&gt; along the x axis and &lt;tt&gt;p&lt;/tt&gt;&lt;i&gt;.y()&lt;/i&gt; along the y axis, relative to the current position. Positive values move the rectangle to the right and down.&lt;/p&gt;

@see &lt;a href=&quot;QRegion.html#translate(int, int)&quot;&gt;&lt;tt&gt;translate&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QRegion united(com.trolltech.qt.gui.QRegion r)" doc="/**
&lt;p&gt;Returns a region which is the union of this region and &lt;tt&gt;r&lt;/tt&gt;.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;%2E%2E/images/runion.png&quot; alt=&quot;Region Union&quot; /&gt;&lt;/p&gt;&lt;p&gt;The figure shows the union of two elliptical regions.&lt;/p&gt;

@see &lt;a href=&quot;QRegion.html#intersected(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;intersected&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QRegion.html#subtracted(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;subtracted&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QRegion.html#xored(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;xored&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QRegion xored(com.trolltech.qt.gui.QRegion r)" doc="/**
&lt;p&gt;Returns a region which is the exclusive or (XOR) of this region and &lt;tt&gt;r&lt;/tt&gt;.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;%2E%2E/images/rxor.png&quot; alt=&quot;Region XORed&quot; /&gt;&lt;/p&gt;&lt;p&gt;The figure shows the exclusive or of two elliptical regions.&lt;/p&gt;

@see &lt;a href=&quot;QRegion.html#intersected(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;intersected&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QRegion.html#united(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;united&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QRegion.html#subtracted(com.trolltech.qt.gui.QRegion)&quot;&gt;&lt;tt&gt;subtracted&lt;/tt&gt;&lt;/a&gt; */"/>
    <enum name="RegionType" doc="/**
&lt;p&gt;Specifies the shape of the region to be created.&lt;/p&gt;
 */">
        <enum-value name="Rectangle" doc="/**
&lt;p&gt;the region covers the entire rectangle.&lt;/p&gt;
 */"/>
        <enum-value name="Ellipse" doc="/**
&lt;p&gt;the region is an ellipse inside the rectangle.&lt;/p&gt;
 */"/>
</enum>
</class>
