PyQt question (colors)

Janos Blazi jblazi at hotmail.com
Tue Apr 9 13:48:30 EDT 2002


> > If I say
> >
> >     stat_lab1.setBackgroundColor(QColor("DarkGreen"))
> >
> > and stat_lab is a QLabel, this has the required effect. But if I say
> >
> >     pb.setBackgroundColor(QColor("DarkGreen"))
> >
> > and pb is a QProgressBar object, so this has no effect at all. Can
anybody
> > tell me the reason for this? I use PyQt with Qt 2.3 on a MS-Win2000
> > system.
> >
>
> Using colors in Qt is quite complicated, unfortunately, and it has
> become even more complicated in Qt 3, where setBackgroundColor is
> so deprecated as to have disappeared from PyQt.
>
> In this case I think you will really have to read Troll Tech's
documentation
> to get a real understanding: it's not something that can be accurately
> explained in a Usenet posting. The upshot is that what you perceive
> to be the same thing -- the background of a label and a progressbar,
> are in the Qt system of widget painting different things.

Thank you for your answer.
I tried to read the Trolltech manuals (and your book as well by the way) but
to no avail. Ist it really so difficult to set the two colors of a
progressbar? Does that require 20 lines of code?

J.B.




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----



More information about the Python-list mailing list