The QRegion class specifies a clip region for a painter. More...
#include <qregion.h>
A region can be a rectangle, an ellipse, a polygon or a combination of these.
Regions are combined by creating a new region which is a union, intersection or difference between any two regions.
The region XOR operation is defined as:
a XOR b = (a UNION b) - (a INTERSECTION b)
Example of using complex regions:
void MyWidget::paintEvent( QPaintEvent * ) { QPainter p; // our painter QRegion r1( QRect(100,100,200,80), // r1 = elliptic region QRegion::Ellipse ); QRegion r2( QRect(100,120,90,30) ); // r2 = rectangular region QRegion r3 = r1.intersect( r2 ); // r3 = intersection p.begin( this ); // start painting widget p.setClipRegion( r3 ); // set clip region ... // paint clipped graphics p.end(); // painting done }
See also: QPainter::setClipRegion() and QPainter::setClipRect().
Constructs a polygon region from the point array a.
If winding is TRUE, the polygon region uses the winding algorithm, otherwise the alternative (even-odd) algorithm will be used.
Constructs a rectangular or elliptic region.
Arguments:
Constructs a region which is a shallow copy of r.
Constructs an empty region.
Destroys the region.
Returns TRUE if the region contains the point p, or FALSE if p is outside the region.
Returns TRUE if the region contains the rectangle r, or FALSE if r is outside the region.
Returns a region which is the intersection of this region and r.
Returns TRUE if the region is empty, or FALSE if it is non-empty.
See also: isNull().
Returns TRUE if the region is a null region.
See also: isEmpty().
Returns TRUE if the region is different from r, or FALSE if the regions are equal.
Assigns a shallow copy of r to this region and returns a reference to the region.
Returns TRUE if the region is equal to r, or FALSE if the regions are different.
Returns a region which is r subtracted from this region.
Translates the region dx along the X axis and dy along the Y axis.
Returns a region which is the union of this region and r.
Returns a region which is this region XOR r.
Writes a region to the stream and returns a reference to the stream.
Reads a region from the stream and returns a reference to the stream.
This file is part of the Qt toolkit, copyright © 1995-96 Troll Tech, all rights reserved.
It was generated from the following files: