PDA

View Full Version : Changing application palette [solved]



maverick_pol
2nd April 2008, 15:51
Hi guys,

I have a simple question about changing application main window and children windows' background color and text color. Before write some code I would like to ask you which is the shortest and the best route to application palette.

The user can choose, from a menu from the main window, to change main window and child windows' window color _>Black and windowText color to blue.

I have 2 ideas for getting what I need:
1) appropriate setPalette(....) for the mainwindow and when a child window is constructed/displayed it should get palette from its' parent
2) setting qApp stylesheet to set window and window text colors

Which option would you suggest? Or maybe different?

Thank for any comment.

Kacper

maverick_pol
2nd April 2008, 16:02
Ok,

I think this solution is the fastest:


void QApplication::setPalette ( const QPalette & palette, const char * className = 0 ) [static]


Kacper