ListView
{
id: view
orientation: Qt.Horizontal
Layout.fillWidth: true
height:64
//model: 180
spacing: -24
clip: true
delegate: Rectangle
{
width: 50
height: parent.height
Image
{
id:imageItem
width:64
height:64
anchors.centerIn: parent
source:getFileName(index*Math.floor(2560/180))
property int current: 0
onSourceChanged:
{
current = index;
}
MouseArea
{
id: mouseArea
anchors.fill: parent
onClicked:
{
var filename = getFileName(Math.floor(2560/180)*imageItem.current)
image.source = filename
}
}
}
function getFileName(index)
{
return "images/"+index+".png"
}
}
}