Skip to content

Instantly share code, notes, and snippets.

@ChALkeR
Last active June 1, 2017 11:12
Show Gist options
  • Save ChALkeR/b6026eef7522fa639640f3dc153a3c30 to your computer and use it in GitHub Desktop.
Save ChALkeR/b6026eef7522fa639640f3dc153a3c30 to your computer and use it in GitHub Desktop.
QML behaviour difference testcase
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