summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@theqtcompany.com>2016-01-14 14:37:58 +0100
committerOliver Wolff <oliver.wolff@qt.io>2016-05-26 05:37:23 +0000
commit9d20d6093e4b037c1038ebb569494065dfd22d7f (patch)
tree57b148061b1f93673d5020aecefe84266e4f6a16 /src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
parent44b56a00335ff283bcef32f1624d6c389c2d6839 (diff)
Detection of bluetooth (LE) devices has to happen in Xaml thread
Change-Id: Ibfc1b272664b989e9836e02674691f24a53a5231 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index a0d024e9..f8a5fca1 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -38,6 +38,7 @@
#include "qfunctions_winrt.h"
#include <QtCore/QLoggingCategory>
+#include <QtCore/private/qeventdispatcher_winrt_p.h>
#include <wrl.h>
#include <windows.devices.enumeration.h>
@@ -165,9 +166,12 @@ public:
void start()
{
- startDeviceDiscovery(BT);
+ QEventDispatcherWinRT::runOnXamlThread([this]() {
+ startDeviceDiscovery(BT);
- startDeviceDiscovery(BTLE);
+ startDeviceDiscovery(BTLE);
+ return S_OK;
+ });
qCDebug(QT_BT_WINRT) << "Worker started";
}