summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qregion.cpp')
-rw-r--r--src/gui/painting/qregion.cpp68
1 files changed, 36 insertions, 32 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 20c62fdd9d..1e778af3f6 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -450,7 +450,10 @@ QDebug operator<<(QDebug s, const QRegion &r)
\sa united(), operator+()
*/
-const QRegion QRegion::operator|(const QRegion &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator|(const QRegion &r) const
{ return united(r); }
/*!
@@ -459,14 +462,20 @@ const QRegion QRegion::operator|(const QRegion &r) const
\sa united(), operator|()
*/
-const QRegion QRegion::operator+(const QRegion &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator+(const QRegion &r) const
{ return united(r); }
/*!
\overload
\since 4.4
*/
-const QRegion QRegion::operator+(const QRect &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator+(const QRect &r) const
{ return united(r); }
/*!
@@ -475,14 +484,20 @@ const QRegion QRegion::operator+(const QRect &r) const
\sa intersected()
*/
-const QRegion QRegion::operator&(const QRegion &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator&(const QRegion &r) const
{ return intersected(r); }
/*!
\overload
\since 4.4
*/
-const QRegion QRegion::operator&(const QRect &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator&(const QRect &r) const
{
return intersected(r);
}
@@ -493,7 +508,10 @@ const QRegion QRegion::operator&(const QRect &r) const
\sa subtracted()
*/
-const QRegion QRegion::operator-(const QRegion &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator-(const QRegion &r) const
{ return subtracted(r); }
/*!
@@ -502,7 +520,10 @@ const QRegion QRegion::operator-(const QRegion &r) const
\sa xored()
*/
-const QRegion QRegion::operator^(const QRegion &r) const
+#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
+const
+#endif
+QRegion QRegion::operator^(const QRegion &r) const
{ return xored(r); }
/*!
@@ -1066,34 +1087,18 @@ Q_GUI_EXPORT QPainterPath qt_regionToPath(const QRegion &region)
struct QRegionPrivate {
int numRects;
+ int innerArea;
QVector<QRect> rects;
QRect extents;
QRect innerRect;
- int innerArea;
inline QRegionPrivate() : numRects(0), innerArea(-1) {}
- inline QRegionPrivate(const QRect &r) {
- numRects = 1;
- extents = r;
- innerRect = r;
- innerArea = r.width() * r.height();
- }
-
- inline QRegionPrivate(const QRegionPrivate &r) {
- rects = r.rects;
- numRects = r.numRects;
- extents = r.extents;
- innerRect = r.innerRect;
- innerArea = r.innerArea;
- }
-
- inline QRegionPrivate &operator=(const QRegionPrivate &r) {
- rects = r.rects;
- numRects = r.numRects;
- extents = r.extents;
- innerRect = r.innerRect;
- innerArea = r.innerArea;
- return *this;
+ inline QRegionPrivate(const QRect &r)
+ : numRects(1),
+ innerArea(r.width() * r.height()),
+ extents(r),
+ innerRect(r)
+ {
}
void intersect(const QRect &r);
@@ -3537,8 +3542,7 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule)
POINTBLOCK *tmpPtBlock;
int numFullPtBlocks = 0;
- if (!(region = new QRegionPrivate))
- return 0;
+ region = new QRegionPrivate;
/* special case a rectangle */
if (((Count == 4) ||