[Qt-interest] QPalette ColorRole-s

Girish Ramakrishnan girish at forwardbias.in
Fri Jan 28 19:00:27 CET 2011


Hi,

On Thu, Jan 27, 2011 at 8:13 PM, Mihail Naydenov <mlists at ymail.com> wrote:
> Is there a particular reason for not having a UserRole last-enum-value in
> ColorRole? So one can define custom roles.
>

QPalette was designed to be the Windows system palette, if you recall
the Windows 2000 appearance/color scheme dialog. It isn't meant to be
extensible since those colors are preset.

> I guess it is to reinforce color reuse, but limits the usability of the class
> for creating custom widgets.
>
> How is this supposed to be handled?
>

You want custom widgets to pull colors from a palette with custom
roles? One approach might be to create a custom palette data structure
and set it as a dynamic property (or style hint) of the application's
QStyle.

Girish



More information about the Qt-interest-old mailing list