Hi,
I have a Q3ListView-Widget and want to color its background. It works if I use this line:
widget->setStyleSheet("QWidget {background-color: rgb(228, 212, 233);}");
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
widget->setStyleSheet("Q3ListView {background-color: rgb(228, 212, 233);}");
widget->setStyleSheet("Q3ListView {background-color: rgb(228, 212, 233);}");
To copy to clipboard, switch view to plain text mode
b) no backbround color
widget->setAccessibleName("test");
widget->setStyleSheet("QWidget[accessibleName=\"test\"] {background-color: rgb(228, 212, 233);}");
widget->setAccessibleName("test");
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
widget->setAccessibleName("test");
widget->setName("test");
widget->setObjectName("test");
widget->setStyleSheet("QWidget#test {background-color: rgb(228, 212, 233);}")
widget->setAccessibleName("test");
widget->setName("test");
widget->setObjectName("test");
widget->setStyleSheet("QWidget#test {background-color: rgb(228, 212, 233);}")
To copy to clipboard, switch view to plain text mode
d) no backbround color
widget->setStyleSheet("QWidget:not(QScrollBar) {background-color: rgb(228, 212, 233);}");
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
Bookmarks