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>
This commit is contained in:
parent
f03941e411
commit
aece0a1356
@ -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
|
recommend using the darker() function for this purpose. If the \a factor
|
||||||
is 0 or negative, the return value is unspecified.
|
is 0 or negative, the return value is unspecified.
|
||||||
|
|
||||||
The function converts the current RGB color to HSV, multiplies the value
|
The function converts the current color to HSV, multiplies the value
|
||||||
(V) component by \a factor and converts the color back to RGB.
|
(V) component by \a factor and converts the color back to it's original
|
||||||
|
color spec.
|
||||||
|
|
||||||
\sa darker(), isValid()
|
\sa darker(), isValid()
|
||||||
*/
|
*/
|
||||||
|
QColor QColor::lighter(int factor) const Q_DECL_NOTHROW
|
||||||
/*!
|
|
||||||
\obsolete
|
|
||||||
|
|
||||||
Use lighter(\a factor) instead.
|
|
||||||
*/
|
|
||||||
QColor QColor::light(int factor) const Q_DECL_NOTHROW
|
|
||||||
{
|
{
|
||||||
if (factor <= 0) // invalid lightness factor
|
if (factor <= 0) // invalid lightness factor
|
||||||
return *this;
|
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
|
but we recommend using the lighter() function for this purpose. If the
|
||||||
\a factor is 0 or negative, the return value is unspecified.
|
\a factor is 0 or negative, the return value is unspecified.
|
||||||
|
|
||||||
The function converts the current RGB color to HSV, divides the value (V)
|
The function converts the current color to HSV, divides the value (V)
|
||||||
component by \a factor and converts the color back to RGB.
|
component by \a factor and converts the color back to it's original
|
||||||
|
color spec.
|
||||||
|
|
||||||
\sa lighter(), isValid()
|
\sa lighter(), isValid()
|
||||||
*/
|
*/
|
||||||
|
QColor QColor::darker(int factor) const Q_DECL_NOTHROW
|
||||||
/*!
|
|
||||||
\obsolete
|
|
||||||
|
|
||||||
Use darker(\a factor) instead.
|
|
||||||
*/
|
|
||||||
QColor QColor::dark(int factor) const Q_DECL_NOTHROW
|
|
||||||
{
|
{
|
||||||
if (factor <= 0) // invalid darkness factor
|
if (factor <= 0) // invalid darkness factor
|
||||||
return *this;
|
return *this;
|
||||||
@ -2770,6 +2760,28 @@ QColor QColor::dark(int factor) const Q_DECL_NOTHROW
|
|||||||
return hsv.convertTo(cspec);
|
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)
|
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||||
/*!
|
/*!
|
||||||
Assigns a copy of \a color to this color, and returns a reference to it.
|
Assigns a copy of \a color to this color, and returns a reference to it.
|
||||||
|
@ -219,9 +219,13 @@ public:
|
|||||||
static QColor fromHsl(int h, int s, int l, int a = 255);
|
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);
|
static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 13)
|
||||||
|
QT_DEPRECATED_X("Use QColor::lighter() instead")
|
||||||
Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW;
|
Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW;
|
||||||
Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW;
|
QT_DEPRECATED_X("Use QColor::darker() instead")
|
||||||
Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW;
|
Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW;
|
||||||
|
#endif
|
||||||
|
Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW;
|
||||||
Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW;
|
Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW;
|
||||||
|
|
||||||
bool operator==(const QColor &c) const Q_DECL_NOTHROW;
|
bool operator==(const QColor &c) const Q_DECL_NOTHROW;
|
||||||
@ -308,12 +312,6 @@ inline QColor::QColor(const QColor &acolor) Q_DECL_NOTHROW
|
|||||||
inline bool QColor::isValid() const Q_DECL_NOTHROW
|
inline bool QColor::isValid() const Q_DECL_NOTHROW
|
||||||
{ return cspec != Invalid; }
|
{ return cspec != Invalid; }
|
||||||
|
|
||||||
inline QColor QColor::lighter(int f) const Q_DECL_NOTHROW
|
|
||||||
{ return light(f); }
|
|
||||||
|
|
||||||
inline QColor QColor::darker(int f) const Q_DECL_NOTHROW
|
|
||||||
{ return dark(f); }
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QCOLOR_H
|
#endif // QCOLOR_H
|
||||||
|
Loading…
Reference in New Issue
Block a user