It is not possible with swap function. but you can change layout orientation or else.
Here is sample code of how change layout orientation with condition...
Container {
property bool isLeft:false
ListView {
id: tradeList
objectName: "tradeList"
dataModel: _app.dataModel
visible: true
function getCurrentDirection(){
return isLeft;
}
listItemComponents: [
ListItemComponent {
type: "header"
Header {
title: {
ListItemData
}
}
},
// The tradeList Item
ListItemComponent {
type: "item"
Container {
id: tadawulList
layout: StackLayout {
// Here is I Changed layout orientation according to value
orientation: tadawulList.ListItem.view.getCurrentDirection()==true ? LayoutOrientation.LeftToRight : LayoutOrientation.RightToLeft
}
// Your more UI here
}
}
]
}
Button {
onClicked: {
isLeft = !isLeft
//Refresh your listview here
}
}
}