[Development] Proposal to deprecate the amazing QApplication::globalStrut

Kai Uwe Broulik kde at privat.broulik.de
Thu Dec 5 15:17:37 CET 2019


Hi,

Am 05.12.19 um 14:25 schrieb Shawn Rutledge:
> So I’m tempted to think that we could try to extend QPalette to store other data types in addition to colors, but it doesn’t look possible to maintain existing API or implementation enough to be worthwhile; and it would tend to become too much of a “kitchen sink” to keep calling it QPalette.

In KDE we have this class KColorScheme [1] which provides semantic color 
roles, like "positive" (usually green, used for success), "neutral" 
(gray or orange), and "negative" (usually red, used for failure), among 
other things, as well as "color sets" (e.g. Window, Button, ToolTip, 
Selection). This way we can have a different link color for Selection, 
so that blue hyperlinks turn white when ontop of a blue list selection.

We use this class extensively throughout our applications but since it 
requires reading KDE configuration files to get the colors, as Qt 
doesn't have them, it pull in a lot of dependencies.

If we had QPalette extended to support semantic colors and color sets, 
we could have them configured by our Platform Theme plug-in and as a 
result drastically reduce our dependency chain.

I don't know how common this concept is on other platforms, though. See 
also our discussion on KDE's Qt 6 workboard: [2].

Cheers
Kai Uwe

[1] 
https://api.kde.org/frameworks/kconfigwidgets/html/classKColorScheme.html
[2] https://phabricator.kde.org/T11587


More information about the Development mailing list