ListView - SmoothedAnimation -> How to stop animation at specific item
Solved
QML and Qt Quick
-
I want to simulate scrooling and generally it works, but I don't know how to stop at specific item. Is there any parameter which set position, where animation should be stopped?
Height of infinite list is 200 px.SmoothedAnimation { target: listviewID easing.type: Easing.InQuart property: "contentY" running: true velocity: 4*200 duration: 1000 from: 0 to: 5 * 200 }
-
Problem solved. It's working animation which changing items in ListView
SmoothedAnimation { id: animacja1 target: listviewID easing.type: Easing.OutCubic property: "contentY" running: animacja_running duration: animation_value * mainListView.animation_height from: listviewID.contentY to: listviewID.contentY + (mainListView.animation_value * mainListView.animation_height) }
mainListView.animation_value - how many items. Value > 0 -> increasing index, Value < 0 -> decreasing index
mainListView.animation_height - height of itemYou can change it using this function
function xx_ustaw(x_value, x_height) { object_value3.animation_height = x_height object_value3.animation_value = x_value object_value3.animacja_running = true }