Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qbluetoothlocaldevice_bluez.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <QtCore/QLoggingCategory>
5#include <QtCore/QRandomGenerator>
6#include <QtDBus/QDBusContext>
7
9#include "qbluetoothaddress.h"
11
14#include "bluez/properties_p.h"
17
19
21
25{
26 d_ptr->currentMode = hostMode();
27}
28
32{
33 d_ptr->currentMode = hostMode();
34}
35
37{
38 if (d_ptr->adapter)
39 return d_ptr->adapter->alias();
40
41 return QString();
42}
43
45{
46 if (d_ptr->adapter)
47 return QBluetoothAddress(d_ptr->adapter->address());
48
49 return QBluetoothAddress();
50}
51
53{
54 if (d_ptr->adapter)
55 d_ptr->adapter->setPowered(true);
56}
57
59{
60 if (!isValid())
61 return;
62
64
65 if (d->pendingHostModeChange != -1) {
66 qCWarning(QT_BT_BLUEZ) << "setHostMode() ignored due to already pending mode change";
67 return;
68 }
69
70 switch (mode) {
73 if (hostMode() == HostPoweredOff) {
74 // We first have to wait for BT to be powered on,
75 // then we can set the host mode correctly
76 d->pendingHostModeChange = static_cast<int>(HostDiscoverable);
77 d->adapter->setPowered(true);
78 } else {
79 d->adapter->setDiscoverable(true);
80 }
81 break;
82 case HostConnectable:
83 if (hostMode() == HostPoweredOff) {
84 d->pendingHostModeChange = static_cast<int>(HostConnectable);
85 d->adapter->setPowered(true);
86 } else {
87 d->adapter->setDiscoverable(false);
88 }
89 break;
90 case HostPoweredOff:
91 d->adapter->setPowered(false);
92 break;
93 }
94}
95
97{
98 if (d_ptr->adapter) {
99 if (!d_ptr->adapter->powered())
100 return HostPoweredOff;
101 else if (d_ptr->adapter->discoverable())
102 return HostDiscoverable;
103 else if (d_ptr->adapter->powered())
104 return HostConnectable;
105 }
106
107 return HostPoweredOff;
108}
109
111{
112 return d_ptr->connectedDevices();
113}
114
116{
117 QList<QBluetoothHostInfo> localDevices;
118
123 reply.waitForFinished();
124 if (reply.isError())
125 return localDevices;
126
127 ManagedObjectList managedObjectList = reply.value();
128 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin();
129 it != managedObjectList.constEnd(); ++it) {
130 const InterfaceList &ifaceList = it.value();
131
132 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd();
133 ++jt) {
134 const QString &iface = jt.key();
135 const QVariantMap &ifaceValues = jt.value();
136
137 if (iface == QStringLiteral("org.bluez.Adapter1")) {
138 QBluetoothHostInfo hostInfo;
139 const QString temp = ifaceValues.value(QStringLiteral("Address")).toString();
140
141 hostInfo.setAddress(QBluetoothAddress(temp));
142 if (hostInfo.address().isNull())
143 continue;
144 hostInfo.setName(ifaceValues.value(QStringLiteral("Name")).toString());
145 localDevices.append(hostInfo);
146 }
147 }
148 }
149 return localDevices;
150}
151
153{
154 if (!isValid() || address.isNull()) {
155 QMetaObject::invokeMethod(this, "errorOccurred", Qt::QueuedConnection,
158 return;
159 }
160
161 const Pairing current_pairing = pairingStatus(address);
162 if (current_pairing == pairing) {
163 if (d_ptr->adapter) {
164 // A possibly running discovery or pending pairing request should be canceled
165 if (d_ptr->pairingDiscoveryTimer && d_ptr->pairingDiscoveryTimer->isActive()) {
166 d_ptr->pairingDiscoveryTimer->stop();
167 }
168
169 if (d_ptr->pairingTarget) {
170 qCDebug(QT_BT_BLUEZ) << "Cancelling pending pairing request to" << d_ptr->pairingTarget->address();
171 QDBusPendingReply<> cancelReply = d_ptr->pairingTarget->CancelPairing();
172 cancelReply.waitForFinished();
173 delete d_ptr->pairingTarget;
174 d_ptr->pairingTarget = nullptr;
175 }
176 }
177 QMetaObject::invokeMethod(this, "pairingFinished", Qt::QueuedConnection,
180 return;
181 }
182
183 d_ptr->requestPairing(address, pairing);
184}
185
187 QBluetoothLocalDevice::Pairing targetPairing)
188{
189 if (!isValid())
190 return;
191
192 //are we already discovering something? -> abort those attempts
193 if (pairingDiscoveryTimer && pairingDiscoveryTimer->isActive()) {
194 pairingDiscoveryTimer->stop();
196 }
197
198 if (pairingTarget) {
199 delete pairingTarget;
200 pairingTarget = nullptr;
201 }
202
203 // pairing implies that the device was found
204 // if we cannot find it we may have to turn on Discovery mode for a limited amount of time
205
206 // check device doesn't already exist
208 reply.waitForFinished();
209 if (reply.isError()) {
211 return;
212 }
213
214 ManagedObjectList managedObjectList = reply.value();
215 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
216 const QDBusObjectPath &path = it.key();
217 const InterfaceList &ifaceList = it.value();
218
219 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
220 const QString &iface = jt.key();
221
222 if (iface == QStringLiteral("org.bluez.Device1")) {
223
225 path.path(),
227 if (targetAddress == QBluetoothAddress(device.address())) {
228 qCDebug(QT_BT_BLUEZ) << "Initiating direct pair to" << targetAddress.toString();
229 //device exist -> directly work with it
230 processPairing(path.path(), targetPairing);
231 return;
232 }
233 }
234 }
235 }
236
237 //no device matching -> turn on discovery
239
240 address = targetAddress;
241 pairing = targetPairing;
242 if (!pairingDiscoveryTimer) {
243 pairingDiscoveryTimer = new QTimer(this);
244 pairingDiscoveryTimer->setSingleShot(true);
245 pairingDiscoveryTimer->setInterval(20000); //20s
246 connect(pairingDiscoveryTimer, &QTimer::timeout,
247 this, &QBluetoothLocalDevicePrivate::pairingDiscoveryTimedOut);
248 }
249
250 qCDebug(QT_BT_BLUEZ) << "Initiating discovery for pairing on" << targetAddress.toString();
251 pairingDiscoveryTimer->start();
252}
253
261void QBluetoothLocalDevicePrivate::processPairing(const QString &objectPath,
263{
264 if (pairingTarget)
265 delete pairingTarget;
266
267 //stop possibly running discovery
268 if (pairingDiscoveryTimer && pairingDiscoveryTimer->isActive()) {
269 pairingDiscoveryTimer->stop();
270
272 }
273
274 pairingTarget = new OrgBluezDevice1Interface(QStringLiteral("org.bluez"), objectPath,
276 const QBluetoothAddress targetAddress(pairingTarget->address());
277
279
280 switch (target) {
282 delete pairingTarget;
283 pairingTarget = nullptr;
284
285 QDBusPendingReply<> removeReply = adapter->RemoveDevice(QDBusObjectPath(objectPath));
286 auto watcher = new QDBusPendingCallWatcher(removeReply, this);
288 this, [q, targetAddress](QDBusPendingCallWatcher* watcher){
290 if (reply.isError())
292 else
293 emit q->pairingFinished(targetAddress, QBluetoothLocalDevice::Unpaired);
294
295 watcher->deleteLater();
296 });
297 break;
298 }
301 pairing = target;
302
303 if (!pairingTarget->paired()) {
304 qCDebug(QT_BT_BLUEZ) << "Sending pairing request to" << pairingTarget->address();
305 //initiate the pairing
306 QDBusPendingReply<> pairReply = pairingTarget->Pair();
309 this, &QBluetoothLocalDevicePrivate::pairingCompleted);
310 return;
311 }
312
313 //already paired but Trust level must be adjusted
314 if (target == QBluetoothLocalDevice::AuthorizedPaired && !pairingTarget->trusted())
315 pairingTarget->setTrusted(true);
316 else if (target == QBluetoothLocalDevice::Paired && pairingTarget->trusted())
317 pairingTarget->setTrusted(false);
318
319 delete pairingTarget;
320 pairingTarget = nullptr;
321
322 emit q->pairingFinished(targetAddress, target);
323
324 break;
325 default:
326 break;
327 }
328}
329
330void QBluetoothLocalDevicePrivate::pairingDiscoveryTimedOut()
331{
332 qCWarning(QT_BT_BLUEZ) << "Discovery for pairing purposes failed. Cannot find parable device.";
333
335
337}
338
340 const QBluetoothAddress &address) const
341{
342 if (address.isNull())
343 return Unpaired;
344
345 if (isValid())
346 {
347 QDBusPendingReply<ManagedObjectList> reply = d_ptr->manager->GetManagedObjects();
348 reply.waitForFinished();
349 if (reply.isError())
350 return Unpaired;
351
352 ManagedObjectList managedObjectList = reply.value();
353 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
354 const QDBusObjectPath &path = it.key();
355 const InterfaceList &ifaceList = it.value();
356
357 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
358 const QString &iface = jt.key();
359
360 if (iface == QStringLiteral("org.bluez.Device1")) {
361
363 path.path(),
365
366 if (address == QBluetoothAddress(device.address())) {
367 if (device.trusted() && device.paired())
368 return AuthorizedPaired;
369 else if (device.paired())
370 return Paired;
371 else
372 return Unpaired;
373 }
374 }
375 }
376 }
377 }
378
379 return Unpaired;
380}
381
384 localAddress(address),
385 pendingHostModeChange(-1),
386 q_ptr(q)
387{
390 initializeAdapter();
391
392 connectDeviceChanges();
393}
394
395bool objectPathIsForThisDevice(const QString &adapterPath, const QString &objectPath)
396{
397 return (!adapterPath.isEmpty() && objectPath.startsWith(adapterPath));
398}
399
400void QBluetoothLocalDevicePrivate::connectDeviceChanges()
401{
402 if (isValid()) {
403 //setup property change notifications for all existing devices
405 reply.waitForFinished();
406 if (reply.isError())
407 return;
408
409 OrgFreedesktopDBusPropertiesInterface *monitor = nullptr;
410
411 ManagedObjectList managedObjectList = reply.value();
412 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
413 const QDBusObjectPath &path = it.key();
414 const InterfaceList &ifaceList = it.value();
415
416 // don't track connected devices from other adapters but the current
417 if (!objectPathIsForThisDevice(deviceAdapterPath, path.path()))
418 continue;
419
420 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
421 const QString &iface = jt.key();
422 const QVariantMap &ifaceValues = jt.value();
423
424 if (iface == QStringLiteral("org.bluez.Device1")) {
425 monitor = new OrgFreedesktopDBusPropertiesInterface(QStringLiteral("org.bluez"),
426 path.path(),
429 this, &QBluetoothLocalDevicePrivate::PropertiesChanged);
430 deviceChangeMonitors.insert(path.path(), monitor);
431
432 if (ifaceValues.value(QStringLiteral("Connected"), false).toBool()) {
433 QBluetoothAddress address(ifaceValues.value(QStringLiteral("Address")).toString());
434 connectedDevicesSet.insert(address);
435 }
436 }
437 }
438 }
439 }
440}
441
443{
444 delete adapter;
445 delete adapterProperties;
446 delete manager;
447 delete pairingTarget;
448
449 qDeleteAll(deviceChangeMonitors);
450}
451
452void QBluetoothLocalDevicePrivate::initializeAdapter()
453{
454 if (adapter)
455 return;
456
457 //get all local adapters
458 if (!manager)
460 QStringLiteral("org.bluez"),
461 QStringLiteral("/"),
463
465 this, &QBluetoothLocalDevicePrivate::InterfacesAdded);
467 this, &QBluetoothLocalDevicePrivate::InterfacesRemoved);
468
469 bool ok = true;
470 const QString adapterPath = findAdapterForAddress(localAddress, &ok);
471 if (!ok || adapterPath.isEmpty())
472 return;
473
474 deviceAdapterPath = adapterPath;
475 adapter = new OrgBluezAdapter1Interface(QStringLiteral("org.bluez"), adapterPath,
477
478 if (adapter) {
479 //hook up propertiesChanged for current adapter
480 adapterProperties = new OrgFreedesktopDBusPropertiesInterface(
481 QStringLiteral("org.bluez"), adapter->path(),
484 this, &QBluetoothLocalDevicePrivate::PropertiesChanged);
485 }
486}
487
488void QBluetoothLocalDevicePrivate::PropertiesChanged(const QString &interface,
489 const QVariantMap &changed_properties,
490 const QStringList &/*invalidated_properties*/,
491 const QDBusMessage &)
492{
493 //qDebug() << "Change" << interface << changed_properties;
494 if (interface == QStringLiteral("org.bluez.Adapter1")) {
495 //update host mode
496 if (changed_properties.contains(QStringLiteral("Discoverable"))
497 || changed_properties.contains(QStringLiteral("Powered"))) {
498
500
501 if (!adapter->powered()) {
503 } else {
504 if (adapter->discoverable())
506 else
508
509 if (pendingHostModeChange != -1) {
510
511 if (static_cast<int>(mode) != pendingHostModeChange) {
512 adapter->setDiscoverable(
513 pendingHostModeChange
514 == static_cast<int>(QBluetoothLocalDevice::HostDiscoverable));
515 pendingHostModeChange = -1;
516 return;
517 }
518 pendingHostModeChange = -1;
519 }
520 }
521
522 if (mode != currentMode)
524
525 currentMode = mode;
526 }
527 } else if (interface == QStringLiteral("org.bluez.Device1")
528 && changed_properties.contains(QStringLiteral("Connected"))) {
529 // update list of connected devices
531 qobject_cast<OrgFreedesktopDBusPropertiesInterface*>(sender());
532 if (!senderIface)
533 return;
534
535 const QString currentPath = senderIface->path();
536 bool isConnected = changed_properties.value(QStringLiteral("Connected"), false).toBool();
537 OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), currentPath,
539 const QBluetoothAddress changedAddress(device.address());
540 bool isInSet = connectedDevicesSet.contains(changedAddress);
541 if (isConnected && !isInSet) {
542 connectedDevicesSet.insert(changedAddress);
543 emit q_ptr->deviceConnected(changedAddress);
544 } else if (!isConnected && isInSet) {
545 connectedDevicesSet.remove(changedAddress);
546 emit q_ptr->deviceDisconnected(changedAddress);
547 }
548 }
549}
550
551void QBluetoothLocalDevicePrivate::InterfacesAdded(const QDBusObjectPath &object_path, InterfaceList interfaces_and_properties)
552{
553 if (interfaces_and_properties.contains(QStringLiteral("org.bluez.Device1"))
554 && !deviceChangeMonitors.contains(object_path.path())) {
555 // a new device was added which we need to add to list of known devices
556
557 if (objectPathIsForThisDevice(deviceAdapterPath, object_path.path())) {
559 QStringLiteral("org.bluez"),
560 object_path.path(),
563 this, &QBluetoothLocalDevicePrivate::PropertiesChanged);
564 deviceChangeMonitors.insert(object_path.path(), monitor);
565
566 const QVariantMap ifaceValues = interfaces_and_properties.value(QStringLiteral("org.bluez.Device1"));
567 if (ifaceValues.value(QStringLiteral("Connected"), false).toBool()) {
568 QBluetoothAddress address(ifaceValues.value(QStringLiteral("Address")).toString());
569 connectedDevicesSet.insert(address);
571 }
572 }
573 }
574
575 if (pairingDiscoveryTimer && pairingDiscoveryTimer->isActive()
576 && interfaces_and_properties.contains(QStringLiteral("org.bluez.Device1"))) {
577 //device discovery for pairing found new remote device
579 object_path.path(), QDBusConnection::systemBus());
580 if (!address.isNull() && address == QBluetoothAddress(device.address()))
581 processPairing(object_path.path(), pairing);
582 }
583}
584
585void QBluetoothLocalDevicePrivate::InterfacesRemoved(const QDBusObjectPath &object_path,
586 const QStringList &interfaces)
587{
588 if (deviceChangeMonitors.contains(object_path.path())
589 && interfaces.contains(QLatin1String("org.bluez.Device1"))) {
590
591 if (objectPathIsForThisDevice(deviceAdapterPath, object_path.path())) {
592 //a device was removed
593 delete deviceChangeMonitors.take(object_path.path());
594
595 //the path contains the address (e.g.: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX)
596 //-> use it to update current list of connected devices
597 QString addressString = object_path.path().right(17);
598 addressString.replace(QStringLiteral("_"), QStringLiteral(":"));
599 const QBluetoothAddress address(addressString);
600 bool found = connectedDevicesSet.remove(address);
601 if (found)
603 }
604 }
605
606 if (adapter && object_path.path() == adapter->path()
607 && interfaces.contains(QLatin1String("org.bluez.Adapter1"))) {
608 qCDebug(QT_BT_BLUEZ) << "Adapter" << adapter->path() << "was removed";
609 // current adapter was removed -> invalidate the instance
610 delete adapter;
611 adapter = nullptr;
613 manager = nullptr;
614 delete adapterProperties;
615 adapterProperties = nullptr;
616
617 delete pairingTarget;
618 pairingTarget = nullptr;
619
620 // turn off connectivity monitoring
621 qDeleteAll(deviceChangeMonitors);
622 deviceChangeMonitors.clear();
623 connectedDevicesSet.clear();
624 }
625}
626
628{
629 return adapter && manager;
630}
631
632QList<QBluetoothAddress> QBluetoothLocalDevicePrivate::connectedDevices() const
633{
634 return connectedDevicesSet.values();
635}
636
637void QBluetoothLocalDevicePrivate::pairingCompleted(QDBusPendingCallWatcher *watcher)
638{
641
642 if (reply.isError()) {
643 qCWarning(QT_BT_BLUEZ) << "Failed to create pairing" << reply.error().name();
644 if (reply.error().name() != QStringLiteral("org.bluez.Error.AuthenticationCanceled"))
646 watcher->deleteLater();
647 return;
648 }
649
650 if (adapter) {
651 if (!pairingTarget) {
652 qCWarning(QT_BT_BLUEZ) << "Pairing target expected but found null pointer.";
654 watcher->deleteLater();
655 return;
656 }
657
658 if (!pairingTarget->paired()) {
659 qCWarning(QT_BT_BLUEZ) << "Device was not paired as requested";
661 watcher->deleteLater();
662 return;
663 }
664
665 const QBluetoothAddress targetAddress(pairingTarget->address());
666
667 if (pairing == QBluetoothLocalDevice::AuthorizedPaired && !pairingTarget->trusted())
668 pairingTarget->setTrusted(true);
669 else if (pairing == QBluetoothLocalDevice::Paired && pairingTarget->trusted())
670 pairingTarget->setTrusted(false);
671
672 delete pairingTarget;
673 pairingTarget = nullptr;
674
675 emit q->pairingFinished(targetAddress, pairing);
676 }
677
678 watcher->deleteLater();
679}
680
682
683#include "moc_qbluetoothlocaldevice_p.cpp"
QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok=nullptr)
QT_BEGIN_NAMESPACE void initializeBluez5()
IOBluetoothDevice * device
void InterfacesAdded(const QDBusObjectPath &object_path, InterfaceList interfaces_and_properties)
void InterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &interfaces)
void PropertiesChanged(const QString &interface, const QVariantMap &changed_properties, const QStringList &invalidated_properties, const QDBusMessage &msg)
\inmodule QtBluetooth
\inmodule QtBluetooth
QBluetoothAddress address() const
Returns the Bluetooth address as a QBluetoothAddress.
void setAddress(const QBluetoothAddress &address)
Sets the Bluetooth address for this Bluetooth host info object.
void setName(const QString &name)
Sets the name of the host info object.
QBluetoothLocalDevicePrivate(QBluetoothLocalDevice *, const QBluetoothAddress &=QBluetoothAddress())
void requestPairing(const QBluetoothAddress &address, Pairing pairing)
\inmodule QtBluetooth
void powerOn()
Powers on the device after returning it to the hostMode() state, if it was powered off.
Pairing
This enum describes the pairing state between the two Bluetooth devices.
void errorOccurred(QBluetoothLocalDevice::Error error)
Signal emitted if there's an exceptional error while pairing.
void requestPairing(const QBluetoothAddress &address, Pairing pairing)
Set the pairing status with address.
HostMode
This enum describes the most of the local Bluetooth device.
HostMode hostMode() const
Returns the current host mode of this local Bluetooth device.
void deviceConnected(const QBluetoothAddress &address)
Error
This enum describes errors that maybe returned.
QList< QBluetoothAddress > connectedDevices() const
QBluetoothLocalDevice(QObject *parent=nullptr)
Constructs a QBluetoothLocalDevice with parent.
QString name() const
Returns the name assgined by the user to this Bluetooth device.
static QList< QBluetoothHostInfo > allDevices()
Returns a list of all available local Bluetooth devices.
Pairing pairingStatus(const QBluetoothAddress &address) const
Returns the current bluetooth pairing status of address, if it's unpaired, paired,...
QBluetoothAddress address() const
Returns the MAC address of this Bluetooth device.
void deviceDisconnected(const QBluetoothAddress &address)
void setHostMode(QBluetoothLocalDevice::HostMode mode)
Sets the host mode of this local Bluetooth device to mode.
void hostModeStateChanged(QBluetoothLocalDevice::HostMode state)
The state of the host has transitioned to a different HostMode.
QString path() const
Returns the object path that this interface is associated with.
static QDBusConnection systemBus()
Returns a QDBusConnection object opened with the system bus.
\inmodule QtDBus
\inmodule QtDBus
QString path() const
Returns this object path.
void finished(QDBusPendingCallWatcher *self=nullptr)
This signal is emitted when the pending call has finished and its reply is available.
\inmodule QtDBus
Definition qlist.h:74
void append(parameter_type t)
Definition qlist.h:441
Definition qmap.h:186
T value(const Key &key, const T &defaultValue=T()) const
Definition qmap.h:356
bool contains(const Key &key) const
Definition qmap.h:340
const_iterator constBegin() const
Definition qmap.h:599
const_iterator constEnd() const
Definition qmap.h:603
NetworkError error() const
Returns the error that was found during the processing of this request.
\inmodule QtCore
Definition qobject.h:90
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
Definition qobject.cpp:2521
void deleteLater()
\threadsafe
Definition qobject.cpp:2352
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QString right(qsizetype n) const
Returns a substring that contains the n rightmost characters of the string.
Definition qstring.cpp:5180
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition qstring.cpp:5299
QString & replace(qsizetype i, qsizetype len, QChar after)
Definition qstring.cpp:3794
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:1083
\inmodule QtCore
Definition qtimer.h:20
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
static QtBluezDiscoveryManager * instance()
bool registerDiscoveryInterest(const QString &adapterPath)
void unregisterDiscoveryInterest(const QString &adapterPath)
#define this
Definition dialogs.cpp:9
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr QBindableInterface iface
Definition qproperty.h:664
@ QueuedConnection
bool objectPathIsForThisDevice(const QString &adapterPath, const QString &objectPath)
QT_BEGIN_NAMESPACE void registerQBluetoothLocalDeviceMetaType()
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char * interface
#define qCWarning(category,...)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
#define Q_ARG(Type, data)
Definition qobjectdefs.h:62
GLenum mode
GLenum target
GLuint GLuint64EXT address
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei const GLchar *const * path
#define QStringLiteral(str)
#define emit
QFutureWatcher< int > watcher
QNetworkAccessManager manager
QNetworkReply * reply
char * toString(const MyType &t)
[31]
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
\threadsafe This is an overloaded member function, provided for convenience. It differs from the abov...
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
Definition utils.h:14