- Qt 6.12
- Qt Quick
- QML Types
- ScaleAnimator
- Qt 6.12.0 Reference Documentation

# ScaleAnimator QML Type

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

Import Statement: | `import QtQuick`
Inherits: | Animator

- List of all members, including inherited members

## 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
         }
     }

Note: Animator types have no benefit when a non-threaded render loop is used.

Note: It is recommended that applications consider designs based on multi-threaded, asynchronous principles, rather than relying on Animators to show animated content while doing expensive, blocking work on the main (GUI) thread. Instead of long, blocking operations, prefer using WorkerScript and asynchronous image loading in QML, and worker threads, parallel algorithms, Qt Concurrent, and coroutines in C++, thus keeping the entire application and UI responsive all the time.

See also Item::transformOrigin and RotationAnimator.