Is there any way to animate QAction button on panel ?



  • I've got some QTabBar with some QActions on it. And I want to make some animation of one of it's actions. For example with the help of 5-6 images. I know that I can make some timer and slot when I will change action's icon for each tick(). But is there any other more standard way to do this ?



  • I think I'd not manipulate the QAction, but create a button that runs the animation instead. Recognize that QAction is not a widget. A QAction put on a QToolBar (not a QTabBar, that one draws tabs) is represented by a QToolButton. You could make your own QToolButton, and for instance put a QLabel on which you put a QMovie. Then, either set that button manually on the tool bar, or wrap the widget in a QWidgetAction.



  • Ok, thanks, Andre. Is there any way to add QToolButton to QToolBar with the help of designer ?(I can't actualy do this when drag'n'drop). Or I need to do this manually in code ?



  • Eh... Not sure. Try and see!
    Do you have objections to writing code?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.