Animation effect of gif in QPushButton
Hi,
I have an animated (attached)gif file. I have set this to a PushButton
icon like in the following :-
Code:
button
->setIcon
(QIcon((":/images/1.gif")));
button
->setIconSize
(QSize(128,
128));
button->setFlat(true);
But I am not able to see the animation effect in the GUI.
Please tell me some body to see animation effect.
Thanks
Santosh
Re: Animation effect of gif in QPushButton
Re: Animation effect of gif in QPushButton
Quote:
Originally Posted by
high_flyer
But QMovie will work for QLabel not for QPushButton.
I want to set the .gif as icon on QPushButton and it should be animated.
Thanks
Santosh
Re: Animation effect of gif in QPushButton
create new class-widget from QPushButton
and reimp paintEvent(QPaintEvent *). Src code of qlabel will help you.
Re: Animation effect of gif in QPushButton
Well, then, subclass QPushButton and add a QLabel member to it.
Problem solved.
Re: Animation effect of gif in QPushButton
Quote:
Originally Posted by
high_flyer
Can u give small sample code for this..
Thanks
Santosh
Re: Animation effect of gif in QPushButton
I'll tell you what - you try first.
If you get in to trouble, post your code, and your question, and I'll help.
Ok?