From 7801d058441df65847a4e64c8681785d966bc07e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 21 Jul 2022 15:39:56 +0200 Subject: [PATCH] Undeprecate QColor(string) constructors They are used in a lot of code, deprecating them now just creates noise and porting effort without adding any value. For Qt 7 we can remove them if we deprecate them in time for the last Qt 6 release, at which point porting effort is expected anway. Leave a ### comment behind to that effect. Change-Id: I0a4e78cf1723b02373d23d7cd52783b3f7095428 Reviewed-by: Eirik Aavitsland (cherry picked from commit a18a88b19bbae81a407645df2bfdd7faa180e323) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qcolor.cpp | 9 +-------- src/gui/painting/qcolor.h | 6 ------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 4a04eb39076..9494aa70e2a 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -784,12 +784,10 @@ QColor::QColor(Spec spec) noexcept } } -#if QT_DEPRECATED_SINCE(6, 6) +// ### Qt 7: remove those after deprecating them for the last Qt 6 LTS release /*! \fn QColor::QColor(const QString &name) - \deprecated [6.6] Use fromString() instead. - Constructs a named color in the same way as setNamedColor() using the given \a name. @@ -801,8 +799,6 @@ QColor::QColor(Spec spec) noexcept /*! \fn QColor::QColor(const char *name) - \deprecated [6.6] Use fromString() instead. - Constructs a named color in the same way as setNamedColor() using the given \a name. @@ -813,8 +809,6 @@ QColor::QColor(Spec spec) noexcept /*! \fn QColor::QColor(QLatin1StringView name) - \deprecated [6.6] Use fromString() instead. - Constructs a named color in the same way as setNamedColor() using the given \a name. @@ -822,7 +816,6 @@ QColor::QColor(Spec spec) noexcept \since 5.8 \sa setNamedColor(), name(), isValid() */ -#endif // QT_DEPRECATED_SINCE(6, 6) /*! \fn bool QColor::isValid() const diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index ba2621968bf..420e44b0860 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -47,16 +47,10 @@ public: 0) {} QColor(QRgb rgb) noexcept; QColor(QRgba64 rgba64) noexcept; -#if QT_DEPRECATED_SINCE(6, 6) - QT_DEPRECATED_VERSION_X_6_6("Use QColor::fromString() instead.") inline QColor(const QString& name); - QT_DEPRECATED_VERSION_X_6_6("Use QColor::fromString() instead.") explicit inline QColor(QStringView name); - QT_DEPRECATED_VERSION_X_6_6("Use QColor::fromString() instead.") inline QColor(const char *aname); - QT_DEPRECATED_VERSION_X_6_6("Use QColor::fromString() instead.") inline QColor(QLatin1StringView name); -#endif QColor(Spec spec) noexcept; static QColor fromString(QAnyStringView name) noexcept;