| 44 | } |
| 45 | |
| 46 | void AnimationPushButton::setAnimation(QMovie *animation, int maxRunningTimeMsec) |
| 47 | { |
| 48 | if(animation->isValid()) { |
| 49 | if(m_animation) { |
| 50 | disconnect(m_animation, &QMovie::frameChanged, this, &AnimationPushButton::setBtnIcon); |
| 51 | } |
| 52 | m_animation = animation; |
| 53 | m_timer->setInterval(maxRunningTimeMsec); |
| 54 | connect(m_animation, &QMovie::frameChanged, this, &AnimationPushButton::setBtnIcon); |
| 55 | } else { |
| 56 | qWarning(CAT_GUI_ANIMATION_BTN) << "The animation " << animation->fileName() + " is not valid!"; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void AnimationPushButton::startAnimation() |
| 61 | { |
no test coverage detected