PDA

View Full Version : Not able to set BackgroundColor of Buttons & TabWidget !



Krish
17th March 2008, 13:40
Hello! Friends,
Previously i was using Qt3.3 in which i was able to set BackgroundColor of any widget say PushButton or TabWidget by changing its paletteBackgroundColor property in the designer mode. But in Qt4.3 i dont see any such option when i open say PushButton's palette property in the designer. Even i didn't get to see any property like setBackgroundColor() for those widgets.

Can anyone please help me in solving the problem. I will be grateful if replied.

Thanks in Advance.:)

wysota
17th March 2008, 14:02
You have to modify an appropriate palette role like QPalette::Window or QPalette::Base depending on the type of the widget. Just be aware this won't work on Windows Vista/XP and MacOSX. If you want another solution, use stylesheets.