PDA

View Full Version : How to reset the Palette for form



donmorr
9th August 2006, 14:17
Hello all,
How do I reset the palette for a form, or get it to use the current Windows/KDE colours?
Cheers,
Donal

jacek
9th August 2006, 14:28
Click on the small red arrow besides "Change Palette" button to reset it.

3dch
12th August 2006, 02:48
If you do it in code try this:

1. create a temporary control
2. get its palette
3. set the palette of the temp. control as the palette of your control

This should also work for forms.

Here's a small code excerpt which shows how to set the default palette for a QTreeView:



QTreeView t; // a temp. control
myTreeView->setPalette(t.palette());


Ernst

jacek
12th August 2006, 13:14
1. create a temporary control
2. get its palette
3. set the palette of the temp. control as the palette of your control
Or simply (for standard Qt widgets):
widget->setPalette( QApplication::palette( widget ) );