Applying style sheets in pyqt
If i apply a property to a parent widget it is automatically applied for child widgets too.. Is there any way of preventing this?? For example if i set background color as white in a dialog the button,combo boxes and scroll bars looks white a开发者_如何学Gos it lacks it native look(have to say it's unpleasant & ugly).. Is there any way that i can apply the stylesheets only to a parent widget not to it's children???
Experts help please..
Found a solution..
Instead of using
self.groupBox.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"border:1px solid rgb(255, 170, 255);")
use specifically using selector types..
self.groupBox.setStyleSheet("QGroupBox { background-color: rgb(255, 255,\
255); border:1px solid rgb(255, 170, 255); }")
This solves the problem..
精彩评论