[Solved] ListView Custom snapMode
-
wrote on 31 Oct 2010, 01:01 last edited by
Hi everyone. I have the following ListView
@import Qt 4.7Rectangle {
width: 500
height:500VisualItemModel { id: itemModel Rectangle { height: 500; width: 500; color: "red" } Rectangle { height: 500; width: 500; color: "green" } Rectangle { height: 500; width: 500; color: "blue" } } ListView { anchors.fill: parent model: itemModel orientation: "Horizontal" highlightRangeMode: ListView.StrictlyEnforceRange boundsBehavior: Flickable.DragOverBounds snapMode: ListView.SnapOneItem }
}
@So when you change from red to green item the listview snap to the green mode(snapMode: ListView.SnapOneItem). What I want is a way to define a custom snapMode, with other words I want to snap first time on on half of the red item width size and then snap to the green item.
It is possible?
-
wrote on 31 Oct 2010, 16:27 last edited by
never mind. I found the solution. for those who are interested:
"preferredHighlightBegin":http://doc.qt.nokia.com/4.7/qml-listview.html#preferredHighlightBegin-prop
1/2