summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcolor.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-16 14:46:49 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-24 11:58:53 +0000
commitaece0a13569737bbcced0e73c0e0b12863e2cf1f (patch)
tree8b12127f9afb37ced13e8f4193402f901ca84266 /src/gui/painting/qcolor.cpp
parentf03941e4113e2c8c0a594592be44efc92614ec9d (diff)
QColor: mark light()/dark() as deprecated
QColor::light()/dark() are deprecated since Qt4 times. Therefore annotate them with Q_DEPRECATED so they can be removed in Qt6. Change-Id: Ifbfc59d6a070670a43c9b60a23f83cc4ba59bf07 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting/qcolor.cpp')
-rw-r--r--src/gui/painting/qcolor.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index a504e35c37..b3fa1eedde 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -2695,18 +2695,13 @@ QColor QColor::fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a)
recommend using the darker() function for this purpose. If the \a factor
is 0 or negative, the return value is unspecified.
- The function converts the current RGB color to HSV, multiplies the value
- (V) component by \a factor and converts the color back to RGB.
+ The function converts the current color to HSV, multiplies the value
+ (V) component by \a factor and converts the color back to it's original
+ color spec.
\sa darker(), isValid()
*/
-
-/*!
- \obsolete
-
- Use lighter(\a factor) instead.
-*/
-QColor QColor::light(int factor) const Q_DECL_NOTHROW
+QColor QColor::lighter(int factor) const Q_DECL_NOTHROW
{
if (factor <= 0) // invalid lightness factor
return *this;
@@ -2745,18 +2740,13 @@ QColor QColor::light(int factor) const Q_DECL_NOTHROW
but we recommend using the lighter() function for this purpose. If the
\a factor is 0 or negative, the return value is unspecified.
- The function converts the current RGB color to HSV, divides the value (V)
- component by \a factor and converts the color back to RGB.
+ The function converts the current color to HSV, divides the value (V)
+ component by \a factor and converts the color back to it's original
+ color spec.
\sa lighter(), isValid()
*/
-
-/*!
- \obsolete
-
- Use darker(\a factor) instead.
-*/
-QColor QColor::dark(int factor) const Q_DECL_NOTHROW
+QColor QColor::darker(int factor) const Q_DECL_NOTHROW
{
if (factor <= 0) // invalid darkness factor
return *this;
@@ -2770,6 +2760,28 @@ QColor QColor::dark(int factor) const Q_DECL_NOTHROW
return hsv.convertTo(cspec);
}
+#if QT_DEPRECATED_SINCE(5, 13)
+/*!
+ \obsolete
+
+ Use lighter(\a factor) instead.
+*/
+QColor QColor::light(int factor) const Q_DECL_NOTHROW
+{
+ return lighter(factor);
+}
+
+/*!
+ \obsolete
+
+ Use darker(\a factor) instead.
+*/
+QColor QColor::dark(int factor) const Q_DECL_NOTHROW
+{
+ return darker(factor);
+}
+#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.