It would be nice to be able use ListModel instead of VisualItemModel. You can do this with with a ListView.
ListModel { id: pageModel
ListElement { title: "Page 1" page: "TextPage.qml" } ListElement { title: "Page 2" page: "ListPage.qml" } ListElement { title: "Page 3" page: "WebPage.qml" } }
ListView { id: pager anchors { fill: parent; topMargin: parent.indicatorHeight} model: root.pageModel delegate: Loader { width: pager.width height: pager.height source: page } preferredHighlightBegin: 0 preferredHighlightEnd: 0 highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal snapMode: ListView.SnapOneItem }
It would be nice to be able use ListModel instead of VisualItemModel. You can do this with with a ListView.
ListModel {
id: pageModel
ListElement {
title: "Page 1"
page: "TextPage.qml"
}
ListElement {
title: "Page 2"
page: "ListPage.qml"
}
ListElement {
title: "Page 3"
page: "WebPage.qml"
}
}
ListView { indicatorHeight }
preferredHighl ightBegin: 0
preferredHighl ightEnd: 0
highlightRange Mode: ListView. StrictlyEnforce Range
orientation: ListView.Horizontal SnapOneItem
id: pager
anchors { fill: parent; topMargin: parent.
model: root.pageModel
delegate: Loader {
width: pager.width
height: pager.height
source: page
}
snapMode: ListView.
}