how to use kanimatedbutton?
Hi,
I'm new to KDE & pyQt.
I am trying to use kanimatedbutton and for now I have no luck,
the overall usage is like the usual Qt button but I dont have any luck on how to add the animation part.
I tried googling but I failed to find an example,
Can someone direct me to resources or example on how to use it?
Thanks!
p.s.
I did find the KDEUI: KanimatedButton reference but they dont explain how to add icons or what file types or anything
Re: how to use kanimatedbutton?
I'm not sure but as I see from the docs and the source code, I guess you have to use setIcons( const QString& icons ) to set the icons and then use start() to start the animation of the icons.
The doc says it "All you need to do is pass along a list of icon names and their size and everything else is taken care of."
Re: how to use kanimatedbutton?
Thanks Archimedes for your reply (and many many inventions :) )
I've seen the setIcons func but,
from what path? how can I connect it to the resources? with is the format of the string?
I'm guessing you dont know,
Do people even use this control? (and again I'm a newbie)
I'm guessing that if it was a widely used control Google would give me more results...
1 Attachment(s)
Re: how to use kanimatedbutton?
Ok here is what I've tried.
Code:
animateBut->setIcons("process-working-kde");
animateBut->start();
Also open the file "process-working-kde.png" (it's located in /usr/share/icons/oxygen/16x16/animations) to see how the image is.
You'll see as 1 image all the frames of the animation.
I've also tried with .gif (no luck) and simple images that wasn't like the above image so I got 1 static icon in the button.
I created the following image in gimp. It's 16x240 with 15 squares that is 15 16x16 frames. Used it as the above code and worked.
Re: how to use kanimatedbutton?
Wow great, that takes me one step forward towards the solution :)
I started reading the KDE basics maybe I'll find how to set the path and connect it to a resource.
Thanks!
Re: how to use kanimatedbutton?
All you need to do is pass along a list of icon names and their size and everything else is taken care of." ??
Re: how to use kanimatedbutton?
Re: how to use kanimatedbutton?
Just to inform: if you change the iconSize() via setIconSize(), you will need to call updateIcons() also to force reloading of the correct icon size.