import QtQuick 2.4
ListView {
height: 400
width: height
model: ListModel {
id: lmodel
ListElement { dummy: 0 }
ListElement { dummy: 0 }
ListElement { dummy: 0 }
ListElement { dummy: 0 }
ListElement { dummy: 0 }
ListElement { dummy: 0 }
}
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
highlightRangeMode: ListView.StrictlyEnforceRange
removeDisplaced: Transition {
PropertyAnimation { property: "x"; duration: 5000 }
}
delegate: Text {
text: index + " of " + lmodel.count
width: 400
height: 400
Rectangle {
color: "green"
anchors.bottom: parent.bottom
height: 100
width: parent.width
Text {
text: "Remove me"
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: lmodel.remove(index)
}
}
}
}