StockListView.qml Example File
demos/stocqt/content/StockListView.qml
import QtQuick 2.0
import "."
Rectangle {
id: root
anchors.top: parent.top
anchors.bottom: parent.bottom
color: "white"
property string currentStockId: ""
property string currentStockName: ""
ListView {
id: view
anchors.fill: parent
clip: true
keyNavigationWraps: true
highlightMoveDuration: 0
focus: true
snapMode: ListView.SnapToItem
model: StockListModel {}
currentIndex: -1
onCurrentIndexChanged: {
if (currentItem) {
root.currentStockId = model.get(currentIndex).stockId;
root.currentStockName = model.get(currentIndex).name;
}
}
delegate: StockListDelegate {}
highlight: Rectangle {
width: view.width
color: "#eeeeee"
}
}
}