summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_p.h')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_p.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
index ee3531cb..489ed807 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.h
@@ -80,7 +80,28 @@ QT_END_NAMESPACE
#endif
#ifdef QT_WIN_BLUETOOTH
-#include <QtConcurrent>
+QT_BEGIN_NAMESPACE
+class QThread;
+
+class ThreadWorkerLE : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE void discover();
+signals:
+ void discoveryCompleted(const QVariant res);
+};
+
+class ThreadWorkerClassic : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE void discover(QVariant hSearch);
+signals:
+ void discoveryCompleted(const QVariant res);
+};
+QT_END_NAMESPACE
+
#elif defined(QT_WINRT_BLUETOOTH)
#include <QtCore/QPointer>
#include <QtCore/QTimer>
@@ -177,9 +198,9 @@ private:
void finishDiscovery(QBluetoothDeviceDiscoveryAgent::Error errorCode, const QString &errorText);
void startLeDevicesDiscovery();
- void completeLeDevicesDiscovery();
+ void completeLeDevicesDiscovery(const QVariant res);
void startClassicDevicesDiscovery(Qt::HANDLE hSearch = nullptr);
- void completeClassicDevicesDiscovery();
+ void completeClassicDevicesDiscovery(const QVariant res);
void processDiscoveredDevice(const QBluetoothDeviceInfo &foundDevice);
@@ -188,8 +209,10 @@ private:
bool pendingStart;
bool active;
- QFutureWatcher<QVariant> *classicScanWatcher;
- QFutureWatcher<QVariant> *lowenergyScanWatcher;
+ QThread *threadLE = nullptr;
+ QThread *threadClassic = nullptr;
+ ThreadWorkerLE *threadWorkerLE = nullptr;
+ ThreadWorkerClassic *threadWorkerClassic = nullptr;
#endif
#ifdef QT_WINRT_BLUETOOTH