For ListView
in QML when currentIndex
is changed programatically onMovementStarted
and onMovementEnded
are not called.
Button {
onClicked: myListView.currentIndex = 2; // Any number within bounds
}
ListView {
id: myListView
orientation: ListView.Horizontal
onMovementStarted: { /*...*/ }
onMovementEnded { /*...*/ }
}
Now when the currentIndex
is changed via the Button
the onMovementStarted
and onMovementEnded
as well as onFlickStarted
, onFlickEnded
handlers are not called.
The model is a set of QML pages which are displayed using the delegate. Just like android screens.
But when the user flickers with the touch screen the handlers are called. How should I get handlers called when ListView
is moved via Button
click?