The downside to stylesheets is that when you set some of it, you end up having 
to define all of it because it knocks off the entire style. See here for 
defining all of the properties you want for a QCheckBox stylesheet:
http://doc.qt.digia.com/stable/stylesheet-examples.html#customizing-qcheckbox

So the alternative, if you just want to set a color, is to update the palette 
for that item:

palette = checkbox.palette()
palette.setColor(palette.Base, QtGui.QColor(255,0,0))
checkbox.setPalette(palette)



On Feb 14, 2013, at 12:58 AM, Panupat Chongstitwattana wrote:

> Hi.
> 
> Trying to color a QCheckBox. But as soon as I add QCheckBox::indicator to the 
> css, the check box isn't responding anymore. 
> 
> checkbox = QtGui.QCheckBox()
> checkbox.setStyleSheet( "::indicator{ background: black; }" )
> 
> Am I doing anything wrong?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to