summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-09-08 04:21:17 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-09-08 04:21:17 (GMT)
commit56776c574a4af02cfa529095a757b80adfb7d189 (patch)
tree75389cd4a08bdb00694ba47002fa9665887b33a0 /src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
parentfb4eb36e78a9d9337fd3decf70a6c13774ba551a (diff)
parentbf8753a822ab610165849b265b5d13685f9ec942 (diff)
downloadQt-56776c574a4af02cfa529095a757b80adfb7d189.zip
Qt-56776c574a4af02cfa529095a757b80adfb7d189.tar.gz
Qt-56776c574a4af02cfa529095a757b80adfb7d189.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index a95e944..12a820f 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -58,35 +58,32 @@ QT_BEGIN_NAMESPACE
\inherits Image
\since 4.7
\ingroup basic-visual-elements
-
- The AnimatedImage element provides for playing animations stored as images containing a series of frames,
- such as GIF files.
-
+
+ The AnimatedImage element extends the features of the \l Image element, providing
+ a way to play animations stored as images containing a series of frames,
+ such as those stored in GIF files.
+
+ Information about the current frame and totla length of the animation can be
+ obtained using the \l currentFrame and \l frameCount properties. You can
+ start, pause and stop the animation by changing the values of the \l playing
+ and \l paused properties.
+
The full list of supported formats can be determined with QMovie::supportedFormats().
- \table
- \row
- \o \image animatedimageitem.gif
- \o
- \qml
- import Qt 4.7
+ \section1 Example Usage
- Rectangle {
- width: animation.width; height: animation.height + 8
+ \beginfloatleft
+ \image animatedimageitem.gif
+ \endfloat
- AnimatedImage { id: animation; source: "animation.gif" }
+ The following QML shows how to display an animated image and obtain information
+ about its state, such as the current frame and total number of frames.
+ The result is an animated image with a simple progress indicator underneath it.
- Rectangle {
- property int frames: animation.frameCount
+ \clearfloat
+ \snippet doc/src/snippets/declarative/animatedimage.qml document
- width: 4; height: 8
- x: (animation.width - width) * animation.currentFrame / frames
- y: animation.height
- color: "red"
- }
- }
- \endqml
- \endtable
+ \sa BorderImage, Image
*/
QDeclarativeAnimatedImage::QDeclarativeAnimatedImage(QDeclarativeItem *parent)
@@ -104,7 +101,8 @@ QDeclarativeAnimatedImage::~QDeclarativeAnimatedImage()
\qmlproperty bool AnimatedImage::paused
This property holds whether the animated image is paused.
- Defaults to false, and can be set to true when you want to pause.
+ By default, this property is false. Set it to true when you want to pause
+ the animation.
*/
bool QDeclarativeAnimatedImage::isPaused() const
{
@@ -128,7 +126,8 @@ void QDeclarativeAnimatedImage::setPaused(bool pause)
\qmlproperty bool AnimatedImage::playing
This property holds whether the animated image is playing.
- Defaults to true, so as to start playing immediately.
+ By defaults, this property is true, meaning that the animation
+ will start playing immediately.
*/
bool QDeclarativeAnimatedImage::isPlaying() const
{
@@ -156,9 +155,11 @@ void QDeclarativeAnimatedImage::setPlaying(bool play)
\qmlproperty int AnimatedImage::currentFrame
\qmlproperty int AnimatedImage::frameCount
- currentFrame is the frame that is currently visible. Watching when this changes can
- allow other things to animate at the same time as the image. frameCount is the number
- of frames in the animation. For some animation formats, frameCount is unknown and set to zero.
+ currentFrame is the frame that is currently visible. By monitoring this property
+ for changes, you can animate other items at the same time as the image.
+
+ frameCount is the number of frames in the animation. For some animation formats,
+ frameCount is unknown and has a value of zero.
*/
int QDeclarativeAnimatedImage::currentFrame() const
{