[Interest] QtQuick - ColorAnimation issue with colors that have alpha

Sletta Gunnar Gunnar.Sletta at digia.com
Mon Nov 25 16:11:56 CET 2013


I am unsure if it is intended or not, but the problem seems to be that you don't have a well defined "base state" to return to when you exit the pressed state. The result is that the transition will go from the pressed state to undefined and only after it completes does it apply the original color.

The fix is either to mark the transition as "reversible: true" in which case it reverts it self based on the original state or perhaps more cleanly, define a base state with property changes that the transition can pick up.

cheers,
Gunnar
________________________________________
Fra: interest-bounces+gunnar.sletta=digia.com at qt-project.org [interest-bounces+gunnar.sletta=digia.com at qt-project.org] på vegne av Preet [prismatic.project at gmail.com]
Sendt: 23. november 2013 01:59
To: <interest at qt-project.org>
Emne: [Interest] QtQuick - ColorAnimation issue with colors that have   alpha

Hi,

I use ColorAnimation to animate a color transition on a rectangle
between two states (say ColorA to ColorB). The default color of the
rectangle is A, and it changes to B when a child MouseArea is pressed.

In the case where ColorA is completely transparent (#00abcdef) and
ColorB is completely opaque, the animation from ColorA->ColorB seems
to work fine. The alpha along with RGB components is faded from A to
B. However, when going back from B to A, it seems like the transition
goes something like ColorB->ColorA(no alpha)->Black->ColorA

This doesn't happen if ColorB has any alpha in it. There's a quick
work around by making ColorB nearly opaque (ie. "#FEabcdef")

Here's a simple example:
http://pastebin.kde.org/pixaqd47y

I'm on Qt 5.2, somewhere around beta from git. Is this a bug?


Preet
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list