~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/quick/qquicksmoothedanimation/data/deleteOnUpdate.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
Rectangle {
 
4
    width: 300; height: 300;
 
5
 
 
6
    Rectangle {
 
7
        color: "red"
 
8
        width: 60; height: 60;
 
9
        x: 100; y: 100;
 
10
 
 
11
        property real prevX: 100
 
12
        onXChanged: {
 
13
            if (x - prevX > 10) {
 
14
                anim.to += 5
 
15
                anim.restart(); //this can cause deletion of backend animation classes
 
16
                prevX = x;
 
17
            }
 
18
        }
 
19
 
 
20
        SmoothedAnimation on x {
 
21
            id: anim
 
22
            objectName: "anim"
 
23
            velocity: 100
 
24
            to: 150
 
25
        }
 
26
    }
 
27
}