qt - QML Viewtransition changes unchanged paramter? -
i trying create smoothly changing list in qml, animations have unexpected side effect. toy code moves around items every time window resized:
import qtquick 2.5 import qtquick.window 2.2 window { visible: true listview { id: listview1 x: 0 y: 0 width: parent.width height: parent.height onwidthchanged: { model.move(0,1,2); } move: transition { smoothedanimation { properties: "x,y" duration: 1000 } } displaced: transition { smoothedanimation { properties: "x,y" duration: 1000 } } delegate: item { x: 5 onxchanged: { console.log("x: ", x) } width: parent.width height: 40 text { text: name anchors.verticalcenter: parent.verticalcenter font.bold: true } } model: listmodel { listelement { name: "grey" } listelement { name: "red" } listelement { name: "blue" } } } } oddly enough, output when play around window:
qml debugging enabled. use in safe environment. qml: x: 0.7840000000000007 qml: x: 0 qml: x: 1.2960000000000003 qml: x: 0 qml: x: 1.2960000000000003 qml: x: 0 and not temporary, items change x position permanently. fault?
Comments
Post a Comment