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>
This commit is contained in:
David Faure 2014-03-18 00:38:56 +01:00 committed by The Qt Project
parent 84f02a9e14
commit 0ccbe33a04
5 changed files with 28 additions and 28 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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) {}

View File

@ -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;

View File

@ -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);