diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-03-13 12:07:06 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-14 08:39:50 +0100 |
commit | 2802eac9bc9ce2c26d09f9598263337287e2765e (patch) | |
tree | 92158ef512f68203f53230326218f113806a8f72 /examples/bluetooth/picturetransfer/DeviceDiscovery.qml | |
parent | 925eaae08427a6d17cf965c6214e19cfa6446d92 (diff) |
Ensure examples behave on default backend and/or with no local Bt device
This patch fixes crashes and ensures that examples give some form of
indication why they are not working.
Change-Id: Id99951e8729c0715505e5fff7448a475979a6406
Reviewed-by: Nedim Hadzic <nhadzic@blackberry.com>
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'examples/bluetooth/picturetransfer/DeviceDiscovery.qml')
-rw-r--r-- | examples/bluetooth/picturetransfer/DeviceDiscovery.qml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/bluetooth/picturetransfer/DeviceDiscovery.qml b/examples/bluetooth/picturetransfer/DeviceDiscovery.qml index 1da77975..77391ec2 100644 --- a/examples/bluetooth/picturetransfer/DeviceDiscovery.qml +++ b/examples/bluetooth/picturetransfer/DeviceDiscovery.qml @@ -79,6 +79,14 @@ Item { //! [Discovery-2] model: BluetoothDiscoveryModel { discoveryMode: BluetoothDiscoveryModel.DeviceDiscovery + onErrorChanged: { + if (error == BluetoothDiscoveryModel.NoError) + return; + if (error == BluetoothDiscoveryModel.PoweredOffError) + titleLabel.text = "Bluetooth turned off"; + else + titleLabel.text = "Cannot find devices"; + } } delegate: Button { |