Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
Copy the documentation back to the scenegraph items, and update it to
the new module syntax.

Change-Id: I5d030a231f991a209a8593ddb069e1b6cd03580e
Reviewed-on: http://codereview.qt.nokia.com/2735
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Aug 9, 2011
1 parent 955c2b0 commit 1a84b19
Show file tree
Hide file tree
Showing 45 changed files with 7,859 additions and 303 deletions.
2 changes: 1 addition & 1 deletion doc/src/declarative/elements.qdoc
Expand Up @@ -32,7 +32,7 @@
\brief A listing of standard QML elements.

These are the functionally grouped lists of QML elements as part of
\l{Qt Quick}.
\l{Qt Quick}. You can also browse the module pages for \l{QtQuick 1}, \l{QtQuick 2} and \l{QtQuick.Particles 2}

Elements are declared with the their name and two curly braces. Elements may
be nested in elements, thereby creating a parent-child relationship between the
Expand Down
7 changes: 5 additions & 2 deletions doc/src/declarative/qtquick1.qdoc
Expand Up @@ -32,6 +32,9 @@
\brief The QML Elements

This QML module contains all the QML elements that are
instantiated as objects of C++ classes in the QtDeclarative
module.
instantiated as objects of C++ classes in the QtQuick1
module. These elements are QGraphicsObject based, and
work with the Graphics View framework. In Qt 5, they
have been replaced by \l{QtQuick 2}, based on the
Scenegraph renderer.
*/
38 changes: 38 additions & 0 deletions doc/src/declarative/qtquick2.qdoc
@@ -0,0 +1,38 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms
** and conditions contained in a signed written agreement between you
** and Nokia.
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\qmlmodule QtQuick 2
\title QML Module QtQuick 2

\brief The QML Elements

This QML module contains all the QML elements that are
instantiated as objects of C++ classes in the QtDeclarative
module. These elements work with the Scenegraph renderer and
their own canvas.
*/
95 changes: 95 additions & 0 deletions src/declarative/items/qsganimatedimage.cpp
Expand Up @@ -52,6 +52,75 @@
#include <private/qdeclarativeengine_p.h>

QT_BEGIN_NAMESPACE
/*!
\qmlclass AnimatedImage QSGAnimatedImage
\inqmlmodule QtQuick 2
\inherits Image
\ingroup basic-visual-elements
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().
\section1 Example Usage
\beginfloatleft
\image animatedimageitem.gif
\endfloat
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.
\bold Note: Unlike images, animated images are not cached or shared internally.
\clearfloat
\snippet doc/src/snippets/declarative/animatedimage.qml document
\sa BorderImage, Image
*/

/*!
\qmlproperty url QtQuick2::AnimatedImage::source
This property holds the URL that refers to the source image.
AnimatedImage can handle any image format supported by Qt, loaded from any
URL scheme supported by Qt.
\sa QDeclarativeImageProvider
*/

/*!
\qmlproperty bool QtQuick2::AnimatedImage::asynchronous
Specifies that images on the local filesystem should be loaded
asynchronously in a separate thread. The default value is
false, causing the user interface thread to block while the
image is loaded. Setting \a asynchronous to true is useful where
maintaining a responsive user interface is more desirable
than having images immediately visible.
Note that this property is only valid for images read from the
local filesystem. Images loaded via a network resource (e.g. HTTP)
are always loaded asynchonously.
*/

/*!
\qmlproperty bool QtQuick2::AnimatedImage::mirror
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
The default value is false.
*/

QSGAnimatedImage::QSGAnimatedImage(QSGItem *parent)
: QSGImage(*(new QSGAnimatedImagePrivate), parent)
Expand All @@ -64,6 +133,14 @@ QSGAnimatedImage::~QSGAnimatedImage()
delete d->_movie;
}

/*!
\qmlproperty bool QtQuick2::AnimatedImage::paused
This property holds whether the animated image is paused.
By default, this property is false. Set it to true when you want to pause
the animation.
*/

bool QSGAnimatedImage::isPaused() const
{
Q_D(const QSGAnimatedImage);
Expand All @@ -83,6 +160,14 @@ void QSGAnimatedImage::setPaused(bool pause)
d->_movie->setPaused(pause);
}

/*!
\qmlproperty bool QtQuick2::AnimatedImage::playing
This property holds whether the animated image is playing.
By default, this property is true, meaning that the animation
will start playing immediately.
*/

bool QSGAnimatedImage::isPlaying() const
{
Q_D(const QSGAnimatedImage);
Expand All @@ -105,6 +190,16 @@ void QSGAnimatedImage::setPlaying(bool play)
d->_movie->stop();
}

/*!
\qmlproperty int QtQuick2::AnimatedImage::currentFrame
\qmlproperty int QtQuick2::AnimatedImage::frameCount
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 QSGAnimatedImage::currentFrame() const
{
Q_D(const QSGAnimatedImage);
Expand Down

0 comments on commit 1a84b19

Please sign in to comment.