Results 1 to 1 of 1

Thread: Stylesheets for Qt3Support Classes

  1. #1
    Join Date
    Jan 2016
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Stylesheets for Qt3Support Classes

    Hi,
    I have a Q3ListView-Widget and want to color its background. It works if I use this line:

    Qt Code:
    1. widget->setStyleSheet("QWidget {background-color: rgb(228, 212, 233);}");
    To copy to clipboard, switch view to plain text mode 

    My problem is, the backgroundcolor changes not only for the Q3ListView-Widget, it also changes the backgroundcolor of childobjects like QScrollBar. The color of childobjects should stay at native OS background color.

    How can i address Qt3Support classes in stylesheets?

    This is what I tried but did not work:
    a) no backbround color
    Qt Code:
    1. widget->setStyleSheet("Q3ListView {background-color: rgb(228, 212, 233);}");
    To copy to clipboard, switch view to plain text mode 
    b) no backbround color
    Qt Code:
    1. widget->setAccessibleName("test");
    2. widget->setStyleSheet("QWidget[accessibleName=\"test\"] {background-color: rgb(228, 212, 233);}");
    To copy to clipboard, switch view to plain text mode 
    c) no backbround color
    Qt Code:
    1. widget->setAccessibleName("test");
    2. widget->setName("test");
    3. widget->setObjectName("test");
    4. widget->setStyleSheet("QWidget#test {background-color: rgb(228, 212, 233);}")
    To copy to clipboard, switch view to plain text mode 
    d) no backbround color
    Qt Code:
    1. widget->setStyleSheet("QWidget:not(QScrollBar) {background-color: rgb(228, 212, 233);}");
    To copy to clipboard, switch view to plain text mode 

    Can anyone explain it to me?

    Thanks,
    Thomas
    Last edited by Thomash; 21st January 2016 at 07:59.

Similar Threads

  1. How to access Classes from another Classes
    By revellix in forum General Programming
    Replies: 1
    Last Post: 4th August 2011, 15:39
  2. construction of classes within classes
    By mobucl in forum Newbie
    Replies: 8
    Last Post: 10th January 2011, 13:51
  3. port ui file with qt3support to qt4 ??
    By darshan.hardas in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 07:15
  4. Replies: 1
    Last Post: 18th April 2007, 20:48
  5. Replies: 9
    Last Post: 11th January 2007, 15:34

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.