missing color roles in Qt (was: Drop-in replacement for QFontComboBox, better previews)

Matthew Woehlke mw_triad at users.sourceforge.net
Thu May 15 01:29:30 BST 2008

(Sorry for bumping an older thread, I've been unable to read NNTP for 
several days)

Thiago Macieira wrote:
> There is a colour palette in Qt and, if an entry is missing, we can think 
> of adding it.

How do you define "missing"? (Not counting states, where Qt and KDE have 
parity,) Qt defines 19 color roles. KDE defines *90* (at present), not 
counting shades[1]. KColorScheme isn't an evolution of QPalette but a 
complete re-engineering based on recognizing distinct color sets, plus 
vastly increasing the roles available within a set (each set in KDE has 
18 colors[2]; Qt only provides from two to five of them, depending on 
set, and how you count Link and Visited that /should/ be set-specific 
and aren't).

I've already requested to at least add role-neutral versions of Hover 
and Focused, which would be a great benefit for styles. (KDE allows 
these to be set-specific, but in practice, these two don't work well 
that way.) InactiveText wouldn't be a bad addition, but text roles are 
more likely to be problematic when not defined per-set; as noted, Link 
and Visited are already problematic in this respect. And then, what 
about the remaining four roles; PositiveText, NeutralText, NegativeText 
and ActiveText?

And yes, I do hope Qt5 will pick up what KColorScheme has started. But I 
don't particularly expect it in Qt4, because it *is* new and very 
different (and not really compatible with Qt's current two-variable role 
partitioning). We (KDE) are playing testbed, here :-).

(1. Granted, at present KDE more-or-less kills the possibility of shades 
being arbitrary, as opposed to formulaic based on their reference color. 
Conversely, KDE's shade support is much, much better than Qt's, which 
only offers "built-in" shades for one color.)

(2. One could argue that only 10 out of the 18 are "important"; the 
latter six background roles can be - and currently are - derived, and 
the decoration pair as mentioned aren't necessarily set-dependent. But 
that's still at best twice Qt's current offerings.)

[/rant] ;-)

Don't get me wrong, I'm not opposed to improving QPalette in Qt4, but I 
am *very* curious where you would draw the line between QPalette-4.4 and 

References: The references have been deleted in order to protect the 
guilty and avoid enriching the lawyers. -- RFC 1925

More information about the kde-core-devel mailing list