I am not sure how it would work with model.power_cons, but you would need to react to the change of the power consumption, not the change of color, because if the color has already changed, then it makes no sense to animate it anymore (it has already changed to the destination color).
If you don’t want to use a custom property, then maybe you could make a C++ signal for when the power consumption changes and then handle the signal in QML. I’ve never tried that, so I don’t know how you would go about doing that.
↧