Details
-
Task
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
None
-
Independent of Environment. It wont work with any specification.
Description
The example usage of QML AnimatedImage Element here: http://developer.qt.nokia.com/doc/qt-4.8/qml-animatedimage.html needs changes to work properly.
In the example given the property frames will be computed to undefined as the frames is not present inside the AnimatedImage element.
We can also directly compute the frames like this:
x: (animationImg.width - width) * animationImg.currentFrame / animationImg.frameCount
but it will result in non-NOTIFYable properties error as frameChange is not being notified by any event/signal
QDeclarativeExpression: Expression "(function $x() { return (animationImg.width - width) * animationImg.currentFrame / animationImg.frameCount })" depends on non-NOTIFYable properties:
QDeclarativeAnimatedImage::frameCount So to get rid of this we move the status value of the status bar into AnimatedImage element like below:
import QtQuick 1.1 Rectangle { width: animation.width; height: animation.height + 10 property int xx; AnimatedImage { id: animation; source: "Images/ExampleAnimation.gif" onCurrentFrameChanged: { xx = (animation.width-status.width) * (animation.currentFrame/animation.frameCount) } } Rectangle { id: status //property int frames: animation.frameCount width: 4; height: 10 x: parent.xx y: animation.height color: "red" } }
This works fine.
<mouli_> helped me to solve this issue in #qt-qml . ThankYou <mouli_>.