ScaleAnimator QML Type

The ScaleAnimator type animates the scale factor of an Item. More...

Import Statement: import QtQuick 2.7
Since: Qt 5.2
Inherits:

Animator

Detailed Description

Animator types are different from normal Animation types. When using an Animator, the animation can be run in the render thread and the property value will jump to the end when the animation is complete.

The value of Item::scale is updated after the animation has finished.

The following snippet shows how to use a ScaleAnimator together with a Rectangle item.

Rectangle {
    id: scalingBox
    width: 50
    height: 50
    color: "lightsteelblue"
    ScaleAnimator {
        target: scalingBox;
        from: 0.5;
        to: 1;
        duration: 1000
        running: true
    }
}

It is also possible to use the on keyword to tie the ScaleAnimator directly to an Item instance.

Rectangle {
    width: 50
    height: 50
    color: "lightsteelblue"
    ScaleAnimator on scale {
        from: 0.5;
        to: 1;
        duration: 1000
    }
}

See also Item::transformOrigin and RotationAnimator.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.