RemoteDevice.qml Example File
bluetoothsppchat/assets/RemoteDevice.qml
import bb.cascades 1.0
Page {
actions: [
ActionItem {
title: qsTr("Device Info")
imageSource: "asset:///images/local_device.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
qsDeviceInfo.open();
}
},
ActionItem {
title: qsTr("Connect SPP")
imageSource: "asset:///images/broadcasts.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
_btController.chatManager.connectToSPPService();
navigationPane.push(chatPage.createObject())
}
}
]
Container {
Container {
ListView {
dataModel: _btController.remoteDeviceInfo.model
listItemComponents: [
ListItemComponent {
type: "listItem"
StandardListItem {
title: ListItemData.uuid
description: ListItemData.address
}
}
]
function itemType(data, indexPath) {
if (indexPath.length == 1) {
return "header";
} else {
return "listItem";
}
}
}
}
attachedObjects: [
RemoteDeviceInfoSheet {
id: qsDeviceInfo
},
ComponentDefinition {
id: chatPage
source: "SPPChat.qml"
}
]
}
}