diff options
author | David Faure <david.faure@kdab.com> | 2014-03-18 00:38:56 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-02 10:03:46 +0200 |
commit | 0ccbe33a0453902264beefaaec22a0ec74cba678 (patch) | |
tree | 1065ae64cdb871dc1b97f573225fc21502072090 /src/gui/painting | |
parent | 84f02a9e144095bb5ecb89e7accada83ff415523 (diff) |
QtGui: Use Q_REQUIRED_RESULT in many more places
gcc doesn't yet warn when a non-POD return datatype is unused,
but clang does, at least.
Change-Id: Ia4c39001994ac09cf20e458bc5a66710bd11780c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qcolor.h | 10 | ||||
-rw-r--r-- | src/gui/painting/qmatrix.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qpolygon.h | 10 | ||||
-rw-r--r-- | src/gui/painting/qregion.h | 28 | ||||
-rw-r--r-- | src/gui/painting/qtransform.h | 6 |
5 files changed, 28 insertions, 28 deletions
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index 1ede5a3682..e5de2678a4 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -173,7 +173,7 @@ public: QColor toCmyk() const; QColor toHsl() const; - QColor convertTo(Spec colorSpec) const; + QColor convertTo(Spec colorSpec) const Q_REQUIRED_RESULT; static QColor fromRgb(QRgb rgb); static QColor fromRgba(QRgb rgba); @@ -190,10 +190,10 @@ public: static QColor fromHsl(int h, int s, int l, int a = 255); static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0); - QColor light(int f = 150) const; - QColor lighter(int f = 150) const; - QColor dark(int f = 200) const; - QColor darker(int f = 200) const; + QColor light(int f = 150) const Q_REQUIRED_RESULT; + QColor lighter(int f = 150) const Q_REQUIRED_RESULT; + QColor dark(int f = 200) const Q_REQUIRED_RESULT; + QColor darker(int f = 200) const Q_REQUIRED_RESULT; QColor &operator=(const QColor &); QColor &operator=(Qt::GlobalColor color); diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index d2c1ae3a3c..93062899d3 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -100,7 +100,7 @@ public: bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); } qreal determinant() const { return _m11*_m22 - _m12*_m21; } - QMatrix inverted(bool *invertible = 0) const; + QMatrix inverted(bool *invertible = 0) const Q_REQUIRED_RESULT; bool operator==(const QMatrix &) const; bool operator!=(const QMatrix &) const; diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h index 1039e842ab..b696fe279a 100644 --- a/src/gui/painting/qpolygon.h +++ b/src/gui/painting/qpolygon.h @@ -71,8 +71,8 @@ public: void translate(int dx, int dy); void translate(const QPoint &offset); - QPolygon translated(int dx, int dy) const; - inline QPolygon translated(const QPoint &offset) const; + QPolygon translated(int dx, int dy) const Q_REQUIRED_RESULT; + inline QPolygon translated(const QPoint &offset) const Q_REQUIRED_RESULT; QRect boundingRect() const; @@ -88,9 +88,9 @@ public: bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const; - QPolygon united(const QPolygon &r) const; - QPolygon intersected(const QPolygon &r) const; - QPolygon subtracted(const QPolygon &r) const; + QPolygon united(const QPolygon &r) const Q_REQUIRED_RESULT; + QPolygon intersected(const QPolygon &r) const Q_REQUIRED_RESULT; + QPolygon subtracted(const QPolygon &r) const Q_REQUIRED_RESULT; }; inline QPolygon::QPolygon(int asize) : QVector<QPoint>(asize) {} diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index 0e436e3fb4..323a1858fa 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -86,23 +86,23 @@ public: void translate(int dx, int dy); inline void translate(const QPoint &p) { translate(p.x(), p.y()); } - QRegion translated(int dx, int dy) const; - inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); } + QRegion translated(int dx, int dy) const Q_REQUIRED_RESULT; + inline QRegion translated(const QPoint &p) const Q_REQUIRED_RESULT { return translated(p.x(), p.y()); } - 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; + QRegion united(const QRegion &r) const Q_REQUIRED_RESULT; + QRegion united(const QRect &r) const Q_REQUIRED_RESULT; + QRegion intersected(const QRegion &r) const Q_REQUIRED_RESULT; + QRegion intersected(const QRect &r) const Q_REQUIRED_RESULT; + QRegion subtracted(const QRegion &r) const Q_REQUIRED_RESULT; + QRegion xored(const QRegion &r) const Q_REQUIRED_RESULT; #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); } + inline QT_DEPRECATED QRegion unite(const QRegion &r) const Q_REQUIRED_RESULT { return united(r); } + inline QT_DEPRECATED QRegion unite(const QRect &r) const Q_REQUIRED_RESULT { return united(r); } + inline QT_DEPRECATED QRegion intersect(const QRegion &r) const Q_REQUIRED_RESULT { return intersected(r); } + inline QT_DEPRECATED QRegion intersect(const QRect &r) const Q_REQUIRED_RESULT { return intersected(r); } + inline QT_DEPRECATED QRegion subtract(const QRegion &r) const Q_REQUIRED_RESULT { return subtracted(r); } + inline QT_DEPRECATED QRegion eor(const QRegion &r) const Q_REQUIRED_RESULT { return xored(r); } #endif bool intersects(const QRegion &r) const; diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index 060362f63e..e6acbe0490 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -104,9 +104,9 @@ public: qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33); - QTransform inverted(bool *invertible = 0) const; - QTransform adjoint() const; - QTransform transposed() const; + QTransform inverted(bool *invertible = 0) const Q_REQUIRED_RESULT; + QTransform adjoint() const Q_REQUIRED_RESULT; + QTransform transposed() const Q_REQUIRED_RESULT; QTransform &translate(qreal dx, qreal dy); QTransform &scale(qreal sx, qreal sy); |