PDA

View Full Version : Animated icon on QTabWidget title



ramazangirgin
22nd March 2010, 14:49
I wan to set animated icon to tab page title.
How can i do this ?

ramazangirgin
30th March 2010, 06:56
isn't there answer or comment about this topic?

aamer4yu
30th March 2010, 09:28
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

foxyproxy
31st March 2010, 07:51
What about using void QTabBar::setTabButton(int index, ButtonPosition position, QWidget * widget)? You can add QLabel and set a movie on it.

QLabel *animationLabel = static_cast<QLabel*>(tabBar->tabButton(index, QTabBar::LeftSide));
if (!animationLabel) {
animationLabel = new QLabel(this);
}
if (!loadingAnimation->movie()) {
QMovie *movie = new QMovie(":images/animation.gif", QByteArray(), animationLabel);
animationLabel->setMovie(movie);
movie->start();
}
tabBar->setTabButton(index, QTabBar::LeftSide, animationLabel);

ramazangirgin
15th July 2010, 12:44
Thanks for reply
Its working


What about using void QTabBar::setTabButton(int index, ButtonPosition position, QWidget * widget)? You can add QLabel and set a movie on it.

QLabel *animationLabel = static_cast<QLabel*>(tabBar->tabButton(index, QTabBar::LeftSide));
if (!animationLabel) {
animationLabel = new QLabel(this);
}
if (!loadingAnimation->movie()) {
QMovie *movie = new QMovie(":images/animation.gif", QByteArray(), animationLabel);
animationLabel->setMovie(movie);
movie->start();
}
tabBar->setTabButton(index, QTabBar::LeftSide, animationLabel);