[Development] Qt5.2 application palette

Martin Koller kollix at aon.at
Thu Dec 5 17:06:15 CET 2013


On Thursday 05 December 2013 15:27:29 Bache-Wiig Jens wrote:
> 
> On 05 Dec 2013, at 15:31, Martin Koller <kollix at aon.at> wrote:
> 
> > I'm at ec03058fa5b84b4570a2158bf2179f7ba4d83b99 and I see something I can not explain:
> > 
> >  QApplication app(argc, argv);
> > 
> >  cerr << "style:" << qPrintable(QApplication::style()->objectName()) << std::endl;
> > 
> >  QPalette pal = QApplication::palette();
> >  cerr << "dark:" << qPrintable(pal.brush(QPalette::Dark).color().name()) << endl;
> > 
> > 
> > this code tells me the style I use is "fusion" and the "dark" value is #000000
> > 
> > However using this code
> > 
> >  extern QPalette qt_fusionPalette();
> > 
> >  QPalette fpal = qt_fusionPalette();
> > 
> > tells me that dark is #9f9d9a
> > 
> > 
> > I was thinking the style defines the default palette.
> > 
> > When compiling against Qt 4.8.5 and using -style plastique I get "dark" as #6a6563
> > 
> > I'm struggling with this as "dark" is the background color of a QMdiArea and in Qt4 it is really gray
> > as documented, but in Qt5 it's black.
> 
> 
> It’s not that simple. The fusionPalette is actually only used to populate the QStyle::standardPalette() and is rarely used by Qt itself unless you _explicitly_ apply it to your QApplication. Depending on the platform you are on, the application palette should automatically be derived from your desktop settings such as KDE or Windows colour schemes and fusion will make use of those instead.

> I suspect you have a broken configuration file or perhaps Qt5 is incorrectly parsing your system settings. It is not really possible to know what is wrong without more information about your platform or setup.

ok, sorry for the missing details.
I'm on Linux (openSuse 13.1) using KDE 4.12 beta, Qt5 self compiled (but it also happens with Qt 5.1.1 from openSuse).
The style in KDE I use is QtCurve. I also checked now my color settings but found nothing strange.

I found the code which parses kdeglobals (QKdeThemePrivate::readKdeSystemPalette()).
I have extracted the color settings of this file and attached it
-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
-------------- next part --------------
[Colors:Button]
BackgroundAlternate=224,223,222
BackgroundNormal=207,204,201
DecorationFocus=58,167,221
DecorationHover=110,214,255
ForegroundActive=255,128,224
ForegroundInactive=137,136,135
ForegroundLink=0,87,174
ForegroundNegative=191,3,3
ForegroundNeutral=176,128,0
ForegroundNormal=27,25,24
ForegroundPositive=0,110,40
ForegroundVisited=255,128,0

[Colors:Selection]
BackgroundAlternate=62,138,204
BackgroundNormal=67,172,232
DecorationFocus=58,167,221
DecorationHover=110,214,255
ForegroundActive=255,128,224
ForegroundInactive=165,193,228
ForegroundLink=0,49,110
ForegroundNegative=156,14,14
ForegroundNeutral=255,221,0
ForegroundNormal=255,255,255
ForegroundPositive=128,255,128
ForegroundVisited=255,128,0

[Colors:Tooltip]
BackgroundAlternate=196,224,255
BackgroundNormal=189,223,255
DecorationFocus=58,167,221
DecorationHover=110,214,255
ForegroundActive=255,128,224
ForegroundInactive=137,136,135
ForegroundLink=0,87,174
ForegroundNegative=191,3,3
ForegroundNeutral=176,128,0
ForegroundNormal=37,35,33
ForegroundPositive=0,110,40
ForegroundVisited=255,128,0

[Colors:View]
BackgroundAlternate=248,247,246
BackgroundNormal=255,255,255
DecorationFocus=58,167,221
DecorationHover=110,214,255
ForegroundActive=255,128,224
ForegroundInactive=137,136,135
ForegroundLink=0,87,174
ForegroundNegative=191,3,3
ForegroundNeutral=176,128,0
ForegroundNormal=0,0,0
ForegroundPositive=0,110,40
ForegroundVisited=255,128,0

[Colors:Window]
BackgroundAlternate=218,217,216
BackgroundNormal=213,209,207
DecorationFocus=58,167,221
DecorationHover=110,214,255
ForegroundActive=255,128,224
ForegroundInactive=137,136,135
ForegroundLink=0,87,174
ForegroundNegative=191,3,3
ForegroundNeutral=176,128,0
ForegroundNormal=0,0,0
ForegroundPositive=0,110,40
ForegroundVisited=255,128,0


More information about the Development mailing list