Results 1 to 2 of 2

Thread: Not able to set BackgroundColor of Buttons & TabWidget !

  1. #1
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Not able to set BackgroundColor of Buttons & TabWidget !

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Not able to set BackgroundColor of Buttons & TabWidget !

    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.

  3. The following user says thank you to wysota for this useful post:

    Krish (17th March 2008)

Similar Threads

  1. Adding buttons on the tab part of a tabwidget
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2006, 17:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.