Results 1 to 5 of 5

Thread: Animated icon on QTabWidget title

  1. #1
    Join Date
    Jul 2007
    Posts
    35
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Animated icon on QTabWidget title

    I wan to set animated icon to tab page title.
    How can i do this ?

  2. #2
    Join Date
    Jul 2007
    Posts
    35
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Animated icon on QTabWidget title

    isn't there answer or comment about this topic?

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Animated icon on QTabWidget title

    Not sure, but did you try setting a .gif as an icon ?
    If that doesnt work too, seems you have to inherit and do it yourself

  4. #4
    Join Date
    Mar 2008
    Posts
    16
    Thanks
    3
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Animated icon on QTabWidget title

    What about using void QTabBar::setTabButton(int index, ButtonPosition position, QWidget * widget)? You can add QLabel and set a movie on it.
    Qt Code:
    1. QLabel *animationLabel = static_cast<QLabel*>(tabBar->tabButton(index, QTabBar::LeftSide));
    2. if (!animationLabel) {
    3. animationLabel = new QLabel(this);
    4. }
    5. if (!loadingAnimation->movie()) {
    6. QMovie *movie = new QMovie(":images/animation.gif", QByteArray(), animationLabel);
    7. animationLabel->setMovie(movie);
    8. movie->start();
    9. }
    10. tabBar->setTabButton(index, QTabBar::LeftSide, animationLabel);
    To copy to clipboard, switch view to plain text mode 

  5. The following 2 users say thank you to foxyproxy for this useful post:

    Ev_genus (10th March 2011), ramazangirgin (15th July 2010)

  6. #5
    Join Date
    Jul 2007
    Posts
    35
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Animated icon on QTabWidget title

    Thanks for reply
    Its working

    Quote Originally Posted by foxyproxy View Post
    What about using void QTabBar::setTabButton(int index, ButtonPosition position, QWidget * widget)? You can add QLabel and set a movie on it.
    Qt Code:
    1. QLabel *animationLabel = static_cast<QLabel*>(tabBar->tabButton(index, QTabBar::LeftSide));
    2. if (!animationLabel) {
    3. animationLabel = new QLabel(this);
    4. }
    5. if (!loadingAnimation->movie()) {
    6. QMovie *movie = new QMovie(":images/animation.gif", QByteArray(), animationLabel);
    7. animationLabel->setMovie(movie);
    8. movie->start();
    9. }
    10. tabBar->setTabButton(index, QTabBar::LeftSide, animationLabel);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QTabWidget with no text and icon
    By martinn in forum Qt Programming
    Replies: 12
    Last Post: 22nd April 2015, 12:04
  2. QTreeWidgetItem animated icon
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2010, 18:09
  3. Replies: 0
    Last Post: 6th September 2009, 21:58
  4. Animated icon on SystemTray
    By arbi in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2008, 14:35
  5. Pb with animated gif on Mac os
    By mourad in forum Qt Programming
    Replies: 0
    Last Post: 17th April 2008, 13:38

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.