aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanimations/data/targetsDeletedWithoutRemoval.qml
blob: e31caa1905267a03706ea316730ab97fb48a0e66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import QtQuick

Item {
    id: root

    property list<Translate> targets
    property alias animTargets: animation.targets

    Component {
        id: trComponent
        Translate {}
    }

    Component.onCompleted: {
        const target = trComponent.createObject(this);
        targets.push(target);
        target.destroy();
        // give event loop some time to actually stop the animation and destroy the target
        Qt.callLater(animation.start);
    }

    NumberAnimation {
        id: animation
        targets: root.targets
        property: "x"
        running: false
        to: 100
    }
}