PDA

View Full Version : Stylesheets for Qt3Support Classes



Thomash
21st January 2016, 07:55
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);}");

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);}");

b) no backbround color


widget->setAccessibleName("test");
widget->setStyleSheet("QWidget[accessibleName=\"test\"] {background-color: rgb(228, 212, 233);}");

c) no backbround color


widget->setAccessibleName("test");
widget->setName("test");
widget->setObjectName("test");
widget->setStyleSheet("QWidget#test {background-color: rgb(228, 212, 233);}")

d) no backbround color


widget->setStyleSheet("QWidget:not(QScrollBar) {background-color: rgb(228, 212, 233);}");


Can anyone explain it to me?

Thanks,
Thomas