summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-01-15 21:16:29 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-16 13:48:30 +0100
commit3b973971fb1e483b9b3514358a415781c3c24ba8 (patch)
treedaee77b57d9949b61880d07fb5482932534da467
parentbb5ae21c417b0c2571f3d5c1025758eaec2c380e (diff)
Fix ###'es in qrect.h
Change-Id: Id9635b6faeaf12ba2f7a0f70055b0df01cd16587 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
-rw-r--r--src/corelib/tools/qrect.h51
1 files changed, 14 insertions, 37 deletions
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index 94e69e637d..34000750ee 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -136,29 +136,23 @@ public:
bool contains(int x, int y) const; // inline methods, _don't_ merge these
bool contains(int x, int y, bool proper) const;
bool contains(const QRect &r, bool proper = false) const;
- QRect unite(const QRect &r) const; // ### Qt 5: make QT4_SUPPORT
QRect united(const QRect &other) const;
- QRect intersect(const QRect &r) const; // ### Qt 5: make QT4_SUPPORT
QRect intersected(const QRect &other) const;
bool intersects(const QRect &r) const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED QRect unite(const QRect &r) const { return united(r); }
+ QT_DEPRECATED QRect intersect(const QRect &r) const { return intersected(r); }
+#endif
+
friend Q_CORE_EXPORT_INLINE bool operator==(const QRect &, const QRect &);
friend Q_CORE_EXPORT_INLINE bool operator!=(const QRect &, const QRect &);
private:
- // ### Qt 5; remove the ifdef and just have the same order on all platforms.
-#if defined(Q_OS_MAC)
- int y1;
- int x1;
- int y2;
- int x2;
-#else
int x1;
int y1;
int x2;
int y2;
-#endif
-
};
Q_DECLARE_TYPEINFO(QRect, Q_MOVABLE_TYPE);
@@ -440,24 +434,14 @@ inline QRect& QRect::operator&=(const QRect &r)
return *this;
}
-inline QRect QRect::intersect(const QRect &r) const
-{
- return *this & r;
-}
-
inline QRect QRect::intersected(const QRect &other) const
{
- return intersect(other);
-}
-
-inline QRect QRect::unite(const QRect &r) const
-{
- return *this | r;
+ return *this & other;
}
inline QRect QRect::united(const QRect &r) const
{
- return unite(r);
+ return *this | r;
}
inline bool operator==(const QRect &r1, const QRect &r2)
@@ -557,12 +541,15 @@ public:
bool contains(const QPointF &p) const;
bool contains(qreal x, qreal y) const;
bool contains(const QRectF &r) const;
- QRectF unite(const QRectF &r) const; // ### Qt 5: make QT4_SUPPORT
QRectF united(const QRectF &other) const;
- QRectF intersect(const QRectF &r) const; // ### Qt 5: make QT4_SUPPORT
QRectF intersected(const QRectF &other) const;
bool intersects(const QRectF &r) const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED QRectF unite(const QRectF &r) const { return united(r); }
+ QT_DEPRECATED QRectF intersect(const QRectF &r) const { return intersected(r); }
+#endif
+
friend Q_CORE_EXPORT_INLINE bool operator==(const QRectF &, const QRectF &);
friend Q_CORE_EXPORT_INLINE bool operator!=(const QRectF &, const QRectF &);
@@ -777,24 +764,14 @@ inline QRectF& QRectF::operator&=(const QRectF &r)
return *this;
}
-inline QRectF QRectF::intersect(const QRectF &r) const
-{
- return *this & r;
-}
-
inline QRectF QRectF::intersected(const QRectF &r) const
{
- return intersect(r);
-}
-
-inline QRectF QRectF::unite(const QRectF &r) const
-{
- return *this | r;
+ return *this & r;
}
inline QRectF QRectF::united(const QRectF &r) const
{
- return unite(r);
+ return *this | r;
}
inline bool operator==(const QRectF &r1, const QRectF &r2)