summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-01-15 21:59:10 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-17 14:44:30 +0100
commit445c4cb011fd2048e707d82c1ae6945353c6cb1d (patch)
tree797c408e2cee2742c0c8b2cab78868bdd1951aac
parentcf0d5d4554999bfe34e65ddea52726543246fc73 (diff)
Mark obsolete methods in qregion as deprecated
Make them inline as well, so they don't create symbols. Change-Id: I779103d6752e75809d16632c8c0eb374cdbd9705 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
-rw-r--r--src/gui/painting/qregion.cpp12
-rw-r--r--src/gui/painting/qregion.h29
2 files changed, 21 insertions, 20 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 68338602e2..cf947630bc 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -3930,7 +3930,7 @@ void QRegion::translate(int dx, int dy)
OffsetRegion(*d->qt_rgn, dx, dy);
}
-QRegion QRegion::unite(const QRegion &r) const
+QRegion QRegion::united(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn))
return r;
@@ -3993,7 +3993,7 @@ QRegion& QRegion::operator+=(const QRegion &r)
}
}
-QRegion QRegion::unite(const QRect &r) const
+QRegion QRegion::united(const QRect &r) const
{
if (isEmptyHelper(d->qt_rgn))
return r;
@@ -4054,7 +4054,7 @@ QRegion& QRegion::operator+=(const QRect &r)
}
}
-QRegion QRegion::intersect(const QRegion &r) const
+QRegion QRegion::intersected(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn) || isEmptyHelper(r.d->qt_rgn)
|| !EXTENTCHECK(&d->qt_rgn->extents, &r.d->qt_rgn->extents))
@@ -4099,7 +4099,7 @@ QRegion QRegion::intersect(const QRegion &r) const
return result;
}
-QRegion QRegion::intersect(const QRect &r) const
+QRegion QRegion::intersected(const QRect &r) const
{
if (isEmptyHelper(d->qt_rgn) || r.isEmpty()
|| !EXTENTCHECK(&d->qt_rgn->extents, &r))
@@ -4125,7 +4125,7 @@ QRegion QRegion::intersect(const QRect &r) const
return result;
}
-QRegion QRegion::subtract(const QRegion &r) const
+QRegion QRegion::subtracted(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn) || isEmptyHelper(r.d->qt_rgn))
return *this;
@@ -4150,7 +4150,7 @@ QRegion QRegion::subtract(const QRegion &r) const
return result;
}
-QRegion QRegion::eor(const QRegion &r) const
+QRegion QRegion::xored(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn)) {
return r;
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 834a015ceb..22ee5ae228 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -92,20 +92,21 @@ public:
QRegion translated(int dx, int dy) const;
inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
- // ### Qt 5: make these four functions QT4_SUPPORT
- QRegion unite(const QRegion &r) const;
- QRegion unite(const QRect &r) const;
- QRegion intersect(const QRegion &r) const;
- QRegion intersect(const QRect &r) const;
- QRegion subtract(const QRegion &r) const;
- QRegion eor(const QRegion &r) const;
-
- inline QRegion united(const QRegion &r) const { return unite(r); }
- inline QRegion united(const QRect &r) const { return unite(r); }
- inline QRegion intersected(const QRegion &r) const { return intersect(r); }
- inline QRegion intersected(const QRect &r) const { return intersect(r); }
- inline QRegion subtracted(const QRegion &r) const { return subtract(r); }
- inline QRegion xored(const QRegion &r) const { return eor(r); }
+ QRegion united(const QRegion &r) const;
+ QRegion united(const QRect &r) const;
+ QRegion intersected(const QRegion &r) const;
+ QRegion intersected(const QRect &r) const;
+ QRegion subtracted(const QRegion &r) const;
+ QRegion xored(const QRegion &r) const;
+
+#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED QRegion unite(const QRegion &r) const { return united(r); }
+ inline QT_DEPRECATED QRegion unite(const QRect &r) const { return united(r); }
+ inline QT_DEPRECATED QRegion intersect(const QRegion &r) const { return intersected(r); }
+ inline QT_DEPRECATED QRegion intersect(const QRect &r) const { return intersected(r); }
+ inline QT_DEPRECATED QRegion subtract(const QRegion &r) const { return subtracted(r); }
+ inline QT_DEPRECATED QRegion eor(const QRegion &r) const { return xored(r); }
+#endif
bool intersects(const QRegion &r) const;
bool intersects(const QRect &r) const;