[PyKDE] QLCDNumber color/style
larry.tami at gte.net
Thu Sep 18 21:57:00 BST 2003
> Tony Cappellini wrote:
>> Would someone point me to an example on how to change the look of a
>> QLCDNumber widget ? I would like to change the color, and perhaps
>> make it bold, or just easier to read. The grey is hard to see at a
>> Is it even possible to change the colors on this widget ?
> To make it more readable, try either
> QLCDNumber.setSegmentStyle(QLCDNumber.Filled) or
> The filled option has a nice highlight, but still looks grey at small
> sizes. Flat has no highlight, so it is dark at any size.
> For an example, see <http://bellz.org/rpcalc/>.
> I've never tried chnaging the color, but I assume you could call
> QWidget.setPalette(...) like any other widget.
You're correct, here's some code I wrote some time ago:
black = QColor("black")
green = QColor("green")
red = QColor("red")
self.safeColor = QPalette()
self.warnColor = QPalette()
For this app, I am keeping track of the number of users connected to my
jabber server, and I want the color to change on the LCD when the number
goes over a certain threshold. The above code snippet just sets up two
palettes, and I can switch between them like this:
if (count < 1000):
> PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
More information about the PyQt