diff options
author | Teemu Holappa <teemu.holappa@qt.io> | 2017-02-27 10:24:53 +0200 |
---|---|---|
committer | Teemu Holappa <teemu.holappa@qt.io> | 2017-05-03 06:32:17 +0000 |
commit | 48fb704e64300387f99c4192436728858c8aa4f8 (patch) | |
tree | 1891c25100a6cdf0f1260c0c5ca1f469887828c8 /src/settingsui/bluetooth/Bluetooth.qml | |
parent | 314de829065a3fa411b8fed90ff1289b000e229b (diff) |
Fix issue when no Bluetooth device is available
Added async scan of the bluetooth adapter.
Done some cleanup to the public class.
Task-number: QTBUG-57676
Change-Id: Ia845f2f8c18fb8272160167482e5124c0b43fee7
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Diffstat (limited to 'src/settingsui/bluetooth/Bluetooth.qml')
-rw-r--r-- | src/settingsui/bluetooth/Bluetooth.qml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/settingsui/bluetooth/Bluetooth.qml b/src/settingsui/bluetooth/Bluetooth.qml index 309f978..72b4ae6 100644 --- a/src/settingsui/bluetooth/Bluetooth.qml +++ b/src/settingsui/bluetooth/Bluetooth.qml @@ -47,6 +47,7 @@ Item { title: qsTr("Bluetooth status") Layout.fillWidth: true Layout.alignment: Qt.AlignTop + enabled: BtDevice.available RowLayout { spacing: 10 @@ -56,8 +57,19 @@ Item { } Switch { checked: BtDevice.powered - onCheckedChanged: BtDevice.powered = checked + onCheckedChanged: { + BtDevice.powered = checked + } } + + Connections { + target: BtDevice + onPoweredChanged: { + if (BtDevice.powered) + BtDevice.scanning = true + } + } + Label { text: qsTr("On") } |