diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index a05e426..261cc5c 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -72,13 +72,22 @@ QT_BEGIN_NAMESPACE \o \image animatedimageitem.gif \o \qml -Item { - width: anim.width; height: anim.height+8 - AnimatedImage { id: anim; source: "pics/games-anim.gif" } - Rectangle { color: "red"; width: 4; height: 8; y: anim.height - x: (anim.width-width)*anim.currentFrame/(anim.frameCount-1) + import Qt 4.7 + + Rectangle { + width: animation.width; height: animation.height + 8 + + AnimatedImage { id: animation; source: "animation.gif" } + + Rectangle { + property int frames: animation.frameCount + + width: 4; height: 8 + x: (animation.width - width) * animation.currentFrame / frames + y: animation.height + color: "red" + } } -} \endqml \endtable */ @@ -96,7 +105,7 @@ QDeclarativeAnimatedImage::~QDeclarativeAnimatedImage() /*! \qmlproperty bool AnimatedImage::paused - This property holds whether the animated image is paused or not + This property holds whether the animated image is paused. Defaults to false, and can be set to true when you want to pause. */ @@ -120,7 +129,7 @@ void QDeclarativeAnimatedImage::setPaused(bool pause) } /*! \qmlproperty bool AnimatedImage::playing - This property holds whether the animated image is playing or not + This property holds whether the animated image is playing. Defaults to true, so as to start playing immediately. */ |