diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-02-26 10:49:49 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-02-26 14:45:24 +0000 |
commit | 41edb3bd9f373a865d5698ac8c18bf341071eae9 (patch) | |
tree | 0c7ed57d082e002e0bb07dc9d24995e649761a12 /src/quick/items/qquickitemsmodule.cpp | |
parent | bcbdd0d22bb0d6f07d5184fd16de1a9c3a439378 (diff) |
Add finished() signal to AnimatedSprite
It's nicer to respond to a sprite finishing its animation like this:
onFinished: doStuff()
than this:
onRunningChanged: if (!running) doStuff()
In addition, the latter will get executed even if the animation
is manually stopped, whereas finished() is only emitted when the
animation finishes naturally.
[ChangeLog][QtQuick][AnimatedSprite] Added finished() signal to
AnimatedSprite as a convenient way to react to an animation finishing.
Change-Id: I558e8372b54bacacd5695cb0edf97d8b84b373f9
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickitemsmodule.cpp')
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 51a91e1f7a..c63b4021fe 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -422,6 +422,8 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickAnimatedImage, 11>(uri, 2, 11,"AnimatedImage"); #endif qmlRegisterType<QQuickItem, 11>(uri, 2, 11,"Item"); + + qmlRegisterType<QQuickAnimatedSprite, 12>("QtQuick", 2, 12, "AnimatedSprite"); } static void initResources() |