src/hbcore/image/hbiconanimator.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
equal deleted inserted replaced
23:e6ad4ef83b23 28:b7da29130b0e
   201         // so in theory this graphics item might belong to other view, which needs to be updated in the animation.
   201         // so in theory this graphics item might belong to other view, which needs to be updated in the animation.
   202         // Clearing the view information in the animation here so it gets updated next time the animation is started.
   202         // Clearing the view information in the animation here so it gets updated next time the animation is started.
   203         if (d->animation && !d->view) {
   203         if (d->animation && !d->view) {
   204             d->animation->setView(0);
   204             d->animation->setView(0);
   205         }
   205         }
   206 
       
   207         if (d->animation && d->mLoopCountSet && !d->animation->loopCountSet()) {
       
   208             d->animation->setLoopCount(d->mLoopCount);
       
   209         }
       
   210     }
   206     }
   211 }
   207 }
   212 
   208 
   213 /*!
   209 /*!
   214     Paints the animated icon. This is a convenience method and does the same as calling paint() to the
   210     Paints the animated icon. This is a convenience method and does the same as calling paint() to the
   220     Qt::AspectRatioMode aspectRatioMode,
   216     Qt::AspectRatioMode aspectRatioMode,
   221     Qt::Alignment alignment,
   217     Qt::Alignment alignment,
   222     QIcon::Mode mode,
   218     QIcon::Mode mode,
   223     QIcon::State state) const
   219     QIcon::State state) const
   224 {
   220 {
       
   221     if (d->animation && d->mLoopCountSet && !d->animation->loopCountSet()) {
       
   222         d->animation->setLoopCount(d->mLoopCount);
       
   223     }
   225     d->icon.paint(painter, rect, aspectRatioMode, alignment, mode, state);
   224     d->icon.paint(painter, rect, aspectRatioMode, alignment, mode, state);
   226 }
   225 }
   227 
   226 
   228 /*!
   227 /*!
   229   Starts the icon animation if the icon is animated. Otherwise this method
   228   Starts the icon animation if the icon is animated. Otherwise this method