[Qt-interest] How to animate the color of a QLabel

André Somers andre at familiesomers.nl
Fri Jan 7 20:51:19 CET 2011


If you don't want to subclass QLabel, you could use a stylesheet on the label, and just use that to set a new color for each step in the animation. 

André


Verstuurd vanaf mijn iPhone

Op 7 jan. 2011 om 18:14 heeft Wilhelm <wilhelm.meier at fh-kl.de> het volgende geschreven:

> Hi,
> 
> this is a simple question, I guess, but I can't get the right answer:
> 
> I have a QStateMachine with some transitions. One of these transitions
> sets the status of a QLabel from enabled to disabled. And now I want to
> animate this change with an animated color.
> 
> I tried to use a QPropertyAnimation for this transition, but the QLabel
> has no property color. It has only palette, but I can't animate the
> palette in some way (I think, the type QPalette isn't supported by
> QPropertyAnimation).
> 
> I would like to change the color of the label text from the default
> active color to the default inactive color with some different color a
> some keyvalues of the animation.
> 
> Any hints?
> 
> -- 
> Wilhelm
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list