diff options
-rw-r--r-- | src/bluetooth/bluetooth.pro | 1 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro index 68001f5f..e30931e4 100644 --- a/src/bluetooth/bluetooth.pro +++ b/src/bluetooth/bluetooth.pro @@ -200,6 +200,7 @@ config_bluez:qtHaveModule(dbus) { SOURCES -= qlowenergycontroller.cpp } else:winphone { DEFINES += QT_WINRT_BLUETOOTH + QT += core-private # remove dummy warning once platform port is complete include(dummy/dummy.pri) 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"; } |