Last active
June 1, 2017 11:12
-
-
Save ChALkeR/b6026eef7522fa639640f3dc153a3c30 to your computer and use it in GitHub Desktop.
QML behaviour difference testcase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.2 | |
Item { | |
width: 300; height: 300 | |
property bool arg: false | |
Rectangle { | |
id: item | |
color: 'red' | |
width: 100; height: 100 | |
property int a: arg ? 1 : 0 | |
property int b: arg ? 0 : 2 | |
x: 100 * ((a === 0) ? b : (2 - b)) | |
y: arg ? 100 : 0 | |
Behavior on x { XAnimator { duration: 300 } } | |
Behavior on y { YAnimator { duration: 300 } } | |
} | |
Timer { | |
interval: 500; running: true; repeat: true; triggeredOnStart: true | |
onTriggered: arg = !arg | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment