Skip to content

Instantly share code, notes, and snippets.

@celeron55
Created February 28, 2014 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celeron55/e68cae944dd7c8bcdd71 to your computer and use it in GitHub Desktop.
Save celeron55/e68cae944dd7c8bcdd71 to your computer and use it in GitHub Desktop.
import QtQuick 2.0
import Sailfish.Silica 1.0
import MetacraneClient 1.0
Page {
id: page
property string crane_name: "Unknown"
SilicaListView {
id: listView
anchors.fill: parent
header: PageHeader {
title: "\""+crane_name+"\" | Metacrane"
}
//model: MetacraneClient.entities
model: ListModel {
ListElement {testname: "Foo"}
}
delegate: BackgroundItem {
id: delegate
Label {
x: Theme.paddingLarge
//text: "Item "+index
//text: components.description.text
text: testname
anchors.verticalCenter: parent.verticalCenter
color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
}
MouseArea {
anchors.fill: parent
onClicked: {
console.log("Clicked " + index)
console.log("delegate", delegate)
console.log("model", model)
console.log("model.testname", model.testname)
}
}
}
VerticalScrollDecorator {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment