diff options
author | Filipe Azevedo <filipe.azevedo@kdab.com> | 2018-02-28 14:44:06 +0100 |
---|---|---|
committer | Filipe Azevedo <filipe.azevedo@kdab.com> | 2018-05-04 08:53:06 +0000 |
commit | ebd3a13b807c6af2684b42d3912549caf7ef82aa (patch) | |
tree | de330c4809e7c6c0f113200724ca8d8224c2d149 /src/gui/kernel/qpalette.h | |
parent | 4582a103c127da928b73d62d5bd1fe6b8a0d4da3 (diff) |
Add a QPalette color role for placeholder texts
This allow to customize easily placeholders in QLineEdit by example.
Change-Id: I2bb379164376e1d88b42d6c86c2e5b8df99fbc56
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/gui/kernel/qpalette.h')
-rw-r--r-- | src/gui/kernel/qpalette.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h index 71f3d0c3b8..071eddbc4d 100644 --- a/src/gui/kernel/qpalette.h +++ b/src/gui/kernel/qpalette.h @@ -96,7 +96,8 @@ public: AlternateBase, NoRole, ToolTipBase, ToolTipText, - NColorRoles = ToolTipText + 1, + PlaceholderText, + NColorRoles = PlaceholderText + 1, Foreground = WindowText, Background = Window }; Q_ENUM(ColorRole) @@ -141,6 +142,7 @@ public: inline const QBrush &highlightedText() const { return brush(HighlightedText); } inline const QBrush &link() const { return brush(Link); } inline const QBrush &linkVisited() const { return brush(LinkVisited); } + inline const QBrush &placeholderText() const { return brush(PlaceholderText); } bool operator==(const QPalette &p) const; inline bool operator!=(const QPalette &p) const { return !(operator==(p)); } |