[PyQt] stylesheet sub-controlls

Lennart Jansen lord.len at gmx.net
Thu Mar 25 00:58:07 GMT 2010


Hi,

thank for the response... i found the answer by myself by now XD



self.baraction.setStyleSheet("""QProgressBar       
{background-color:           white;
                                                           
text-align:                 center;
                                                           
color:                      black;
                                                           border: 2px 
solid black;
                                                           
border-radius: 6px;}

----->                                      
QProgressBar::chunk{background-color:           green;
----->                                                       
border-radius: 3px;}
                                 """)

my problem was that i didnt get it that the string itself is kinda like 
in c++, i wrote the syntax like python code and since this didnt work i 
started thinking it wouldnt work at all....



Am 25.03.2010 00:45, schrieb Nick Gaens:
> Hello Lennart,
>
> By subcontrols, do you mean something like:
>
> qpushbutton { color: white; }
>
> qpushbutton:pressed { color: black; }
>
> ?
>
> If so, you can set the same stylesheet to a widget as in the "regular" 
> Qt, it has little to do with PyQt itself, since the stylesheet is just 
> a string to be parsed.
>
>
> On Wed, Mar 24, 2010 at 9:22 AM, Lennart Jansen <lord.len at gmx.net 
> <mailto:lord.len at gmx.net>> wrote:
>
>     Hi,
>
>     are there "stylesheet sub-controlls" in pyqt like in qt? For
>     example the widget Qprogressbar in qt got the sub-controll chunk,
>     but i cant find anything like it in pyqt.
>
>     I wish all of you a good day!
>     --
>     Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
>     jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser
>     _______________________________________________
>     PyQt mailing list PyQt at riverbankcomputing.com
>     <mailto:PyQt at riverbankcomputing.com>
>     http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
>
>
> -- 
> Nick Gaens
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100325/07e177eb/attachment-0001.html>


More information about the PyQt mailing list