Results 1 to 2 of 2

Thread: Widgets background problem (styled with CSS)

  1. #1
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Widgets background problem (styled with CSS)

    Hello!
    I need to set backgrounds for my widgets. I use the global css-file and set it using qApp->setStyleSheet.
    At css-file, I need to set separately colors for all widgets and QTabWidget::pane subcontol. So I write:

    Qt Code:
    1. {
    2. background-color: blue;
    3. color: white;
    4. }
    5.  
    6. QTabWidget::pane{
    7. border-top: 1px solid grey;
    8. background-color: red;
    9. }
    To copy to clipboard, switch view to plain text mode 

    The problem is - QWidget's style's background is preffered over QTabWidget::pane. If I comment out QWidget's background-color, the QTabWidget::pane background-color works fine and I see the red background. But if QWidget's background-color is set, the QTabWidget::pane will be the same as QWidget's background-color.
    How to solve this problem?

  2. #2
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: Widgets background problem (styled with CSS)

    I have the same problem in Qt5. Have you solved this problem?

Similar Threads

  1. How to create custom styled widgets ???
    By hgedek in forum Qt Programming
    Replies: 2
    Last Post: 4th October 2011, 00:58
  2. Problem with styled QPushButton clickable area
    By koan in forum Qt Programming
    Replies: 4
    Last Post: 19th July 2011, 23:48
  3. background-image on a set of widgets
    By asieriko in forum Qt Programming
    Replies: 4
    Last Post: 22nd May 2010, 08:59
  4. Replies: 1
    Last Post: 22nd May 2010, 08:54
  5. dark gray widgets/background
    By momesana in forum Qt Programming
    Replies: 8
    Last Post: 17th June 2007, 10:39

Tags for this Thread

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.