main.qml Example File
imageloader/assets/main.qml
import bb.cascades 1.0
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Button {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
text: qsTr("Load images")
onClicked: {
_app.loadImages()
visible = false
listView.visible = true
}
}
ListView {
id: listView
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
visible: false
dataModel: _app.model
listItemComponents: ListItemComponent {
type: ""
Container {
preferredHeight: 500
preferredWidth: 768
layout: DockLayout {}
ActivityIndicator {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredHeight: 300
visible: ListItemData.loading
running: ListItemData.loading
}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
image: ListItemData.image
visible: !ListItemData.loading && ListItemData.label == ""
}
Label {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
preferredWidth: 500
visible: !ListItemData.loading && !ListItemData.label == ""
text: ListItemData.label
multiline: true
}
}
}
}
}
}