Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 as 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..

like image 438
Jeba Avatar asked Mar 08 '10 20:03

Jeba


1 Answers

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..

like image 61
Jeba Avatar answered Sep 24 '22 00:09

Jeba