Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Repaint QIcon or QIconEngine
Is there a way to convince a QIcon or QIconEngine to repaint, analogous to QWidget::update()?
Or is there a better way to go about animating a toolbar icon? Right now I'm constructing a new QIcon for each animation frame. Instead, I was hoping to encapsulate the animation (timer and repaint) inside my derived class of QIconEngine.
i guess you want to display an animated gif icon?
For what type of widget are you using it?
Well, no, I want to implement the animation in code. It's for an activity indicator. Same basic idea as http://qt-project.org/wiki/Busy-Indicator-for-QML, but I wasn't sure how I could use the "independent usage as a widget" code. I have a QAction that has been added to a QToolBar, and would like its icon to change to an activity indicator at certain times.
currently there is no way a QIcon class (etc.) can inform a widget that it has to be redrawn. QMovie can do this though.
You need to either set the QIcon on every frame change or you need to subclass the widget and do the painting of the icon area completley yourself. This can be - depending on the widget - be a pain, especially when you are not that experienced with it.
[quote author="raven-worx" date="1379485277"]currently there is no way a QIcon class (etc.) can inform a widget that it has to be redrawn. QMovie can do this though...[/quote]