On this page

LottieVectorImageController QML Type

Provides animation control for a VectorImage that is displaying a Lottie file. More...

Import Statement: import Qt.labs.lottieqt 1.0
Since: Qt 6.12
Inherits:

QtObject

Properties

Methods

Detailed Description

VectorImage can display and play Lottie animations, but by itself it provides only rudimentary functionality for controlling the playback. LottieVectorImageController extends VectorImage with more powerful API for querying and controlling the animation.

LottieVectorImageController's target property specifies the VectorImage to be controlled. It is set by default if the LottieVectorImageController is created as a child or property of a VectorImage. When the VectorImage has loaded a Lottie file, and its status is Ready, the LottieVectorImageController's properties can be read and written, and its functions called, to control the playback.

Taken together with VectorImage, LottieVectorImageController mimics the API of the existing LottieAnimation item, so they are typically interchangeable with little effort. (The getDuration() function is not provided, since it can be trivially replaced by a simple expression using the endFrame, startFrame and optionally frameRate properties.)

See also VectorImage and qtlottieviewer Example.

Property Documentation

endFrame : real [read-only]

The animation's ending frame number ("out-frame"), as specified in the source file.

frameRate : real

This property holds the animation playback speed in frames per second.

When the vector image is loaded, this property is set to the frame rqate value specified in the source file.

After loading, frameRate can be modified to change the playback speed. Assigning an empty value to it will reset it to the source file value.

startFrame : real [read-only]

The animation's starting frame number ("in-frame"), as specified in the source file.

target : VectorImage

This property specifies the VectorImage to be controlled.

If the LottieVectorImageController is created as a child or property of a VectorImage, that will be the default target. Otherwise, the target must be set explicitly.

Method Documentation

void gotoAndPlay(real frame)

Moves the playback to Lottie frame number frame and plays it.

frame will be clamped between startFrame and endFrame.

void gotoAndStop(real frame)

Moves the playback to Lottie frame number frame and pauses it.

frame will be clamped between startFrame and endFrame.

void pause()

Pauses the playback.

void play()

Starts (un-pauses) the playback.

void play()

Restarts the playback from the startFrame.

void stop()

Resets the playback to the startFrame and pauses it.

void togglePause()

Toggles the target VectorImage between playing and paused modes.

© 2026 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.