From 108e73602d60904b204cc71e9daaee084c66ce7b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 19 Nov 2019 15:43:38 +0100 Subject: Fix Qt6 TODOs in qcolor Do trivial binary but source compatible changes. Change-Id: Ifd2c3dea1dda80a46594ad413425d7800cc74dd8 Reviewed-by: Christian Ehrlicher --- src/gui/painting/qcolor.cpp | 44 -------------------------------------------- src/gui/painting/qcolor.h | 17 +---------------- 2 files changed, 1 insertion(+), 60 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 23afba6cce..c567b25468 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -854,18 +854,6 @@ QColor::QColor(Spec spec) noexcept Returns \c true if the color is valid; otherwise returns \c false. */ -/*! - Returns the name of the color in the format "#RRGGBB"; i.e. a "#" - character followed by three two-digit hexadecimal numbers. - - \sa setNamedColor() -*/ - -QString QColor::name() const -{ - return name(HexRgb); -} - /*! \since 5.2 @@ -2627,16 +2615,6 @@ QColor QColor::fromHslF(qreal h, qreal s, qreal l, qreal a) return color; } -/*! - \obsolete - - Use the \c const overload instead. -*/ -void QColor::getCmyk(int *c, int *m, int *y, int *k, int *a) -{ - const_cast(this)->getCmyk(c, m, y, k, a); -} - /*! Sets the contents pointed to by \a c, \a m, \a y, \a k, and \a a, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components @@ -2666,16 +2644,6 @@ void QColor::getCmyk(int *c, int *m, int *y, int *k, int *a) const *a = ct.acmyk.alpha >> 8; } -/*! - \obsolete - - Use the \c const overload instead. -*/ -void QColor::getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a) -{ - const_cast(this)->getCmykF(c, m, y, k, a); -} - /*! Sets the contents pointed to by \a c, \a m, \a y, \a k, and \a a, to the cyan, magenta, yellow, black, and alpha-channel (transparency) components @@ -2924,18 +2892,6 @@ QColor QColor::dark(int factor) const noexcept } #endif -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) -/*! - Assigns a copy of \a color to this color, and returns a reference to it. -*/ -QColor &QColor::operator=(const QColor &color) noexcept -{ - cspec = color.cspec; - ct.argb = color.ct.argb; - return *this; -} -#endif - /*! \overload Assigns a copy of \a color and returns a reference to this color. */ diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index c3111f9e3b..423a0ac50f 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -89,24 +89,11 @@ public: inline QColor(QLatin1String name); QColor(Spec spec) noexcept; -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - // ### Qt 6: remove all of these, the trivial ones are fine. - Q_DECL_CONSTEXPR QColor(const QColor &color) noexcept - : cspec(color.cspec), ct(color.ct) - {} - Q_DECL_CONSTEXPR QColor(QColor &&other) noexcept : cspec(other.cspec), ct(other.ct) {} - QColor &operator=(QColor &&other) noexcept - { cspec = other.cspec; ct = other.ct; return *this; } - QColor &operator=(const QColor &) noexcept; -#endif // Qt < 6 - QColor &operator=(Qt::GlobalColor color) noexcept; bool isValid() const noexcept; - // ### Qt 6: merge overloads - QString name() const; - QString name(NameFormat format) const; + QString name(NameFormat format = HexRgb) const; #if QT_STRINGVIEW_LEVEL < 2 void setNamedColor(const QString& name); @@ -182,11 +169,9 @@ public: qreal yellowF() const noexcept; qreal blackF() const noexcept; - void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr); // ### Qt 6: remove void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr) const; void setCmyk(int c, int m, int y, int k, int a = 255); - void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = nullptr); // ### Qt 6: remove void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = nullptr) const; void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0); -- cgit v1.2.3