Hi
A small question, from a QT newbie.
I have a small box painted in the painEvent, and I want the colour to fade from one colour to another, over time.
I hope someone have an idea how to do this.
Thanks
Søren- DK.
Hi
A small question, from a QT newbie.
I have a small box painted in the painEvent, and I want the colour to fade from one colour to another, over time.
I hope someone have an idea how to do this.
Thanks
Søren- DK.
First you need a QTimer or QTimeLine that will fire QWidget::update() (or a custom slot which calls update()). The second thing you need to do is to change paintEvent() so that it reads the current state of the animation from somewhere and paints it. The last thing is to keep change the state somehow.
Note that you shouldn't update the animation state in paintEvent() because you can never know when it will be called.
Thanx..
Søren - DK
Bookmarks