Results 1 to 8 of 8

Thread: how to use kanimatedbutton?

  1. #1
    Join Date
    May 2009
    Posts
    11
    Thanks
    3

    Default 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

  2. #2
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default 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."
    Misha R.evolution - High level Debugging IDE

    Programming is about 2 basic principles: KISS and RTFM!!!

  3. #3
    Join Date
    May 2009
    Posts
    11
    Thanks
    3

    Default 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...

  4. #4
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: how to use kanimatedbutton?

    Ok here is what I've tried.

    Qt Code:
    1. animateBut->setIcons("process-working-kde");
    2. animateBut->start();
    To copy to clipboard, switch view to plain text mode 

    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.
    Attached Images Attached Images
    Last edited by Archimedes; 24th February 2010 at 14:28.
    Misha R.evolution - High level Debugging IDE

    Programming is about 2 basic principles: KISS and RTFM!!!

  5. The following user says thank you to Archimedes for this useful post:

    ManicQin (24th February 2010)

  6. #5
    Join Date
    May 2009
    Posts
    11
    Thanks
    3

    Default 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!

  7. #6
    Join Date
    Jul 2017
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default 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." ??

  8. #7
    Join Date
    Nov 2014
    Posts
    32
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Windows

    Default Re: how to use kanimatedbutton?

    You can find information about your question at: https://api.kde.org/4.x-api/kdelibs-...tedButton.html

  9. #8
    Join Date
    Apr 2020
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Windows

    Default 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.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.