diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-08-03 02:08:29 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-08-09 09:04:33 +0200 |
commit | d131abde59190ed5ea8673828bce13fff66c1e3a (patch) | |
tree | fd2c0c48d222e32a186c41e4564a5f4c712a2dde /src/gui/kernel | |
parent | 3469c262fc840e81dc46544a574c9adfdee6ca3d (diff) |
QPixelFormat: implement some oneliners in the class body
There's little point in duplicating the complex declaration (thanks to C++11), just define
the relational operators and the default ctor where they're declared.
Change-Id: Ie91545b2581c89edd434c911eb05705e2d16debe
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qpixelformat.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/gui/kernel/qpixelformat.h b/src/gui/kernel/qpixelformat.h index 40d58f285a..5bf64ac043 100644 --- a/src/gui/kernel/qpixelformat.h +++ b/src/gui/kernel/qpixelformat.h @@ -159,7 +159,7 @@ public: CurrentSystemEndian }; - Q_DECL_CONSTEXPR inline QPixelFormat() Q_DECL_NOTHROW; + Q_DECL_CONSTEXPR inline QPixelFormat() Q_DECL_NOTHROW : data(0) {} Q_DECL_CONSTEXPR inline QPixelFormat(ColorModel colorModel, uchar firstSize, uchar secondSize, @@ -221,8 +221,11 @@ private: private: quint64 data; - friend Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline bool operator==(const QPixelFormat &fmt1, const QPixelFormat &fmt2); - friend Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline bool operator!=(const QPixelFormat &fmt1, const QPixelFormat &fmt2); + friend Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline bool operator==(const QPixelFormat &fmt1, const QPixelFormat &fmt2) + { return fmt1.data == fmt2.data; } + + friend Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline bool operator!=(const QPixelFormat &fmt1, const QPixelFormat &fmt2) + { return !(fmt1 == fmt2); } }; Q_STATIC_ASSERT(sizeof(QPixelFormat) == sizeof(quint64)); Q_DECLARE_TYPEINFO(QPixelFormat, Q_PRIMITIVE_TYPE); @@ -305,12 +308,6 @@ public: }; Q_DECL_CONSTEXPR -QPixelFormat::QPixelFormat() Q_DECL_NOTHROW - : data(0) -{ -} - -Q_DECL_CONSTEXPR QPixelFormat::QPixelFormat(ColorModel mdl, uchar firstSize, uchar secondSize, @@ -341,12 +338,6 @@ QPixelFormat::QPixelFormat(ColorModel mdl, { } -Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline bool operator==(const QPixelFormat &fmt1, const QPixelFormat &fmt2) -{ return fmt1.data == fmt2.data; } - -Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline bool operator!=(const QPixelFormat &fmt1, const QPixelFormat &fmt2) -{ return !(fmt1 == fmt2); } - Q_DECL_CONSTEXPR QPixelFormatRgb::QPixelFormatRgb(uchar red, uchar green, |