I have found this signal onMovementStarted to trigger the changing of loader source.
However I need to know if the user swipe to right before it changes the source.
Is this a correct way to trigger the change of page or there's a better option.
Any suggestions? Thanks
ListView {
id: wizardList
anchors.fill: parent
focus: true
highlightRangeMode: ListView.StrictlyEnforceRange
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
model:
ListModel {
ListElement {
page: "Wizard1.qml"
}
ListElement {
page: "Wizard2.qml"
}
ListElement {
page: "Wizard3.qml"
}
}
delegate: WizardDelegate {}
onMovementStarted: {
if (wizardList.currentIndex == 2) { // i need to include in the condition to check if the swipe direction is to the right
mainLoader.source = "Main.qml"
}
}
}
ListView {
id: wizardList
anchors.fill: parent
focus: true
highlightRangeMode: ListView.StrictlyEnforceRange
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
model:
ListModel {
ListElement {
page: "Wizard1.qml"
}
ListElement {
page: "Wizard2.qml"
}
ListElement {
page: "Wizard3.qml"
}
}
delegate: WizardDelegate {}
onMovementStarted: {
if (wizardList.currentIndex == 2) { // i need to include in the condition to check if the swipe direction is to the right
mainLoader.source = "Main.qml"
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks