PDA

View Full Version : How can I get System setting color



dpatel
20th July 2010, 08:48
Hi,

I want to get the system color for widget background. How can I get that?
Another example would be get the system color for button face.

Thanks.

dpatel
20th July 2010, 09:20
I found the solution



QWidget tmpWidget;
QColor backGroundColor=tmpWidget.palette().color(QPalette ::Window);

Ginsengelf
20th July 2010, 09:20
Hi, use QApplication::palette() and ask its color() method for the color you want.

Ginsengelf

edit: perfectly in sync... For the application's palette you would not need a temporary widget, so I think that's the better way.