QPalette: mark foreground()/background() as deprecated
QPalette::foreground()/background()/ColorRole::Foreground/Background are deprecated since Qt4 times. Therefore mark them as deprecated so they can be removed in Qt6. Change-Id: I24a47e080241b7f16b8adde1f9f16e29133462a7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
parent
f4d72b3a12
commit
4c522e0226
@ -981,7 +981,7 @@ QPalette QPalette::resolve(const QPalette &other) const
|
||||
#ifndef QT_NO_DATASTREAM
|
||||
|
||||
static const int NumOldRoles = 7;
|
||||
static const int oldRoles[7] = { QPalette::Foreground, QPalette::Background, QPalette::Light,
|
||||
static const int oldRoles[7] = { QPalette::WindowText, QPalette::Window, QPalette::Light,
|
||||
QPalette::Dark, QPalette::Mid, QPalette::Text, QPalette::Base };
|
||||
|
||||
/*!
|
||||
|
@ -98,7 +98,10 @@ public:
|
||||
ToolTipBase, ToolTipText,
|
||||
PlaceholderText,
|
||||
NColorRoles = PlaceholderText + 1,
|
||||
Foreground = WindowText, Background = Window
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
Foreground Q_DECL_ENUMERATOR_DEPRECATED_X("Use QPalette::WindowText instead") = WindowText,
|
||||
Background Q_DECL_ENUMERATOR_DEPRECATED_X("Use QPalette::Window instead") = Window
|
||||
#endif
|
||||
};
|
||||
Q_ENUM(ColorRole)
|
||||
|
||||
@ -121,7 +124,6 @@ public:
|
||||
|
||||
inline const QColor &color(ColorRole cr) const { return color(Current, cr); }
|
||||
inline const QBrush &brush(ColorRole cr) const { return brush(Current, cr); }
|
||||
inline const QBrush &foreground() const { return brush(WindowText); }
|
||||
inline const QBrush &windowText() const { return brush(WindowText); }
|
||||
inline const QBrush &button() const { return brush(Button); }
|
||||
inline const QBrush &light() const { return brush(Light); }
|
||||
@ -132,7 +134,6 @@ public:
|
||||
inline const QBrush &alternateBase() const { return brush(AlternateBase); }
|
||||
inline const QBrush &toolTipBase() const { return brush(ToolTipBase); }
|
||||
inline const QBrush &toolTipText() const { return brush(ToolTipText); }
|
||||
inline const QBrush &background() const { return brush(Window); }
|
||||
inline const QBrush &window() const { return brush(Window); }
|
||||
inline const QBrush &midlight() const { return brush(Midlight); }
|
||||
inline const QBrush &brightText() const { return brush(BrightText); }
|
||||
@ -143,6 +144,12 @@ public:
|
||||
inline const QBrush &link() const { return brush(Link); }
|
||||
inline const QBrush &linkVisited() const { return brush(LinkVisited); }
|
||||
inline const QBrush &placeholderText() const { return brush(PlaceholderText); }
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use QPalette::windowText() instead")
|
||||
inline const QBrush &foreground() const { return windowText(); }
|
||||
QT_DEPRECATED_X("Use QPalette::window() instead")
|
||||
inline const QBrush &background() const { return window(); }
|
||||
#endif
|
||||
|
||||
bool operator==(const QPalette &p) const;
|
||||
inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user