Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
23 QObject(parent),
25{
26 d_ptr->currentMode = hostMode();
27}
28
30 QObject(parent),
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
110QList<QBluetoothAddress> QBluetoothLocalDevice::connectedDevices() const
111{
112 return d_ptr->connectedDevices();
113}
114
115QList<QBluetoothHostInfo> QBluetoothLocalDevice::allDevices()
116{
117 QList<QBluetoothHostInfo> localDevices;
118
122 QDBusPendingReply<ManagedObjectList> reply = manager.GetManagedObjects();
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 d_ptr->pairingRequestCanceled = true;
173 cancelReply.waitForFinished();
174 delete d_ptr->pairingTarget;
175 d_ptr->pairingTarget = nullptr;
176 }
177 }
178 QMetaObject::invokeMethod(this, "pairingFinished", Qt::QueuedConnection,
181 return;
182 }
183
184 d_ptr->requestPairing(address, pairing);
185}
186
188 QBluetoothLocalDevice::Pairing targetPairing)
189{
190 if (!isValid())
191 return;
192
193 //are we already discovering something? -> abort those attempts
194 if (pairingDiscoveryTimer && pairingDiscoveryTimer->isActive()) {
195 pairingDiscoveryTimer->stop();
196 QtBluezDiscoveryManager::instance()->unregisterDiscoveryInterest(adapter->path());
197 }
198
199 if (pairingTarget) {
200 delete pairingTarget;
201 pairingTarget = nullptr;
202 }
203
204 // pairing implies that the device was found
205 // if we cannot find it we may have to turn on Discovery mode for a limited amount of time
206
207 // check device doesn't already exist
208 QDBusPendingReply<ManagedObjectList> reply = manager->GetManagedObjects();
209 reply.waitForFinished();
210 if (reply.isError()) {
212 return;
213 }
214
215 ManagedObjectList managedObjectList = reply.value();
216 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
217 const QDBusObjectPath &path = it.key();
218 const InterfaceList &ifaceList = it.value();
219
220 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
221 const QString &iface = jt.key();
222
223 if (iface == QStringLiteral("org.bluez.Device1")) {
224
226 path.path(),
228 if (targetAddress == QBluetoothAddress(device.address())) {
229 qCDebug(QT_BT_BLUEZ) << "Initiating direct pair to" << targetAddress.toString();
230 //device exist -> directly work with it
231 processPairing(path.path(), targetPairing);
232 return;
233 }
234 }
235 }
236 }
237
238 //no device matching -> turn on discovery
239 QtBluezDiscoveryManager::instance()->registerDiscoveryInterest(adapter->path());
240
241 address = targetAddress;
242 pairing = targetPairing;
243 if (!pairingDiscoveryTimer) {
244 pairingDiscoveryTimer = new QTimer(this);
245 pairingDiscoveryTimer->setSingleShot(true);
246 pairingDiscoveryTimer->setInterval(20000); //20s
247 connect(pairingDiscoveryTimer, &QTimer::timeout,
248 this, &QBluetoothLocalDevicePrivate::pairingDiscoveryTimedOut);
249 }
250
251 qCDebug(QT_BT_BLUEZ) << "Initiating discovery for pairing on" << targetAddress.toString();
252 pairingDiscoveryTimer->start();
253}
254
262void QBluetoothLocalDevicePrivate::processPairing(const QString &objectPath,
264{
265 if (pairingTarget)
266 delete pairingTarget;
267
268 //stop possibly running discovery
269 if (pairingDiscoveryTimer && pairingDiscoveryTimer->isActive()) {
270 pairingDiscoveryTimer->stop();
271
272 QtBluezDiscoveryManager::instance()->unregisterDiscoveryInterest(adapter->path());
273 }
274
275 pairingTarget = new OrgBluezDevice1Interface(QStringLiteral("org.bluez"), objectPath,
277 const QBluetoothAddress targetAddress(pairingTarget->address());
278
280
281 switch (target) {
283 delete pairingTarget;
284 pairingTarget = nullptr;
285
286 QDBusPendingReply<> removeReply = adapter->RemoveDevice(QDBusObjectPath(objectPath));
287 auto watcher = new QDBusPendingCallWatcher(removeReply, this);
289 this, [q, targetAddress](QDBusPendingCallWatcher* watcher){
291 if (reply.isError())
293 else
294 emit q->pairingFinished(targetAddress, QBluetoothLocalDevice::Unpaired);
295
296 watcher->deleteLater();
297 });
298 break;
299 }
302 pairing = target;
303
304 if (!pairingTarget->paired()) {
305 qCDebug(QT_BT_BLUEZ) << "Sending pairing request to" << pairingTarget->address();
306 //initiate the pairing
307 QDBusPendingReply<> pairReply = pairingTarget->Pair();
310 this, &QBluetoothLocalDevicePrivate::pairingCompleted);
311 return;
312 }
313
314 //already paired but Trust level must be adjusted
315 if (target == QBluetoothLocalDevice::AuthorizedPaired && !pairingTarget->trusted())
316 pairingTarget->setTrusted(true);
317 else if (target == QBluetoothLocalDevice::Paired && pairingTarget->trusted())
318 pairingTarget->setTrusted(false);
319
320 delete pairingTarget;
321 pairingTarget = nullptr;
322
323 emit q->pairingFinished(targetAddress, target);
324
325 break;
326 default:
327 break;
328 }
329}
330
331void QBluetoothLocalDevicePrivate::pairingDiscoveryTimedOut()
332{
333 qCWarning(QT_BT_BLUEZ) << "Discovery for pairing purposes failed. Cannot find parable device.";
334
335 QtBluezDiscoveryManager::instance()->unregisterDiscoveryInterest(adapter->path());
336
338}
339
341 const QBluetoothAddress &address) const
342{
343 if (address.isNull())
344 return Unpaired;
345
346 if (isValid())
347 {
348 QDBusPendingReply<ManagedObjectList> reply = d_ptr->manager->GetManagedObjects();
349 reply.waitForFinished();
350 if (reply.isError())
351 return Unpaired;
352
353 ManagedObjectList managedObjectList = reply.value();
354 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
355 const QDBusObjectPath &path = it.key();
356 const InterfaceList &ifaceList = it.value();
357
358 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
359 const QString &iface = jt.key();
360
361 if (iface == QStringLiteral("org.bluez.Device1")) {
362
364 path.path(),
366
367 if (address == QBluetoothAddress(device.address())) {
368 if (device.trusted() && device.paired())
369 return AuthorizedPaired;
370 else if (device.paired())
371 return Paired;
372 else
373 return Unpaired;
374 }
375 }
376 }
377 }
378 }
379
380 return Unpaired;
381}
382
385 localAddress(address),
386 pendingHostModeChange(-1),
387 q_ptr(q)
388{
391 initializeAdapter();
392
393 connectDeviceChanges();
394}
395
396bool objectPathIsForThisDevice(const QString &adapterPath, const QString &objectPath)
397{
398 return (!adapterPath.isEmpty() && objectPath.startsWith(adapterPath));
399}
400
401void QBluetoothLocalDevicePrivate::connectDeviceChanges()
402{
403 if (isValid()) {
404 //setup property change notifications for all existing devices
405 QDBusPendingReply<ManagedObjectList> reply = manager->GetManagedObjects();
406 reply.waitForFinished();
407 if (reply.isError())
408 return;
409
410 OrgFreedesktopDBusPropertiesInterface *monitor = nullptr;
411
412 ManagedObjectList managedObjectList = reply.value();
413 for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
414 const QDBusObjectPath &path = it.key();
415 const InterfaceList &ifaceList = it.value();
416
417 // don't track connected devices from other adapters but the current
418 if (!objectPathIsForThisDevice(deviceAdapterPath, path.path()))
419 continue;
420
421 for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
422 const QString &iface = jt.key();
423 const QVariantMap &ifaceValues = jt.value();
424
425 if (iface == QStringLiteral("org.bluez.Device1")) {
426 monitor = new OrgFreedesktopDBusPropertiesInterface(QStringLiteral("org.bluez"),
427 path.path(),
430 this, &QBluetoothLocalDevicePrivate::PropertiesChanged);
431 deviceChangeMonitors.insert(path.path(), monitor);
432
433 if (ifaceValues.value(QStringLiteral("Connected"), false).toBool()) {
434 QBluetoothAddress address(ifaceValues.value(QStringLiteral("Address")).toString());
435 connectedDevicesSet.insert(address);
436 }
437 }
438 }
439 }
440 }
441}
442
444{
445 delete adapter;
446 delete adapterProperties;
447 delete manager;
448 delete pairingTarget;
449
450 qDeleteAll(deviceChangeMonitors);
451}
452
453void QBluetoothLocalDevicePrivate::initializeAdapter()
454{
455 if (adapter)
456 return;
457
458 //get all local adapters
459 if (!manager)
461 QStringLiteral("org.bluez"),
462 QStringLiteral("/"),
464
466 this, &QBluetoothLocalDevicePrivate::InterfacesAdded);
468 this, &QBluetoothLocalDevicePrivate::InterfacesRemoved);
469
470 bool ok = true;
471 const QString adapterPath = findAdapterForAddress(localAddress, &ok);
472 if (!ok || adapterPath.isEmpty())
473 return;
474
475 deviceAdapterPath = adapterPath;
476 adapter = new OrgBluezAdapter1Interface(QStringLiteral("org.bluez"), adapterPath,
478
479 if (adapter) {
480 //hook up propertiesChanged for current adapter
481 adapterProperties = new OrgFreedesktopDBusPropertiesInterface(
482 QStringLiteral("org.bluez"), adapter->path(),
485 this, &QBluetoothLocalDevicePrivate::PropertiesChanged);
486 }
487}
488
489void QBluetoothLocalDevicePrivate::PropertiesChanged(const QString &interface,
490 const QVariantMap &changed_properties,
491 const QStringList &/*invalidated_properties*/,
492 const QDBusMessage &)
493{
494 //qDebug() << "Change" << interface << changed_properties;
495 if (interface == QStringLiteral("org.bluez.Adapter1")) {
496 //update host mode
497 if (changed_properties.contains(QStringLiteral("Discoverable"))
498 || changed_properties.contains(QStringLiteral("Powered"))) {
499
501
502 if (!adapter->powered()) {
504 } else {
505 if (adapter->discoverable())
507 else
509
510 if (pendingHostModeChange != -1) {
511
512 if (static_cast<int>(mode) != pendingHostModeChange) {
513 adapter->setDiscoverable(
514 pendingHostModeChange
515 == static_cast<int>(QBluetoothLocalDevice::HostDiscoverable));
516 pendingHostModeChange = -1;
517 return;
518 }
519 pendingHostModeChange = -1;
520 }
521 }
522
523 if (mode != currentMode)
525
526 currentMode = mode;
527 }
528 } else if (interface == QStringLiteral("org.bluez.Device1")
529 && changed_properties.contains(QStringLiteral("Connected"))) {
530 // update list of connected devices
532 qobject_cast<OrgFreedesktopDBusPropertiesInterface*>(sender());
533 if (!senderIface)
534 return;
535
536 const QString currentPath = senderIface->path();
537 bool isConnected = changed_properties.value(QStringLiteral("Connected"), false).toBool();
538 OrgBluezDevice1Interface device(QStringLiteral("org.bluez"), currentPath,
540 const QBluetoothAddress changedAddress(device.address());
541 bool isInSet = connectedDevicesSet.contains(changedAddress);
542 if (isConnected && !isInSet) {
543 connectedDevicesSet.insert(changedAddress);
544 emit q_ptr->deviceConnected(changedAddress);
545 } else if (!isConnected && isInSet) {
546 connectedDevicesSet.remove(changedAddress);
547 emit q_ptr->deviceDisconnected(changedAddress);
548 }
549 }
550}
551
552void QBluetoothLocalDevicePrivate::InterfacesAdded(const QDBusObjectPath &object_path, InterfaceList interfaces_and_properties)
553{
554 if (interfaces_and_properties.contains(QStringLiteral("org.bluez.Device1"))
555 && !deviceChangeMonitors.contains(object_path.path())) {
556 // a new device was added which we need to add to list of known devices
557
558 if (objectPathIsForThisDevice(deviceAdapterPath, object_path.path())) {
560 QStringLiteral("org.bluez"),
561 object_path.path(),
564 this, &QBluetoothLocalDevicePrivate::PropertiesChanged);
565 deviceChangeMonitors.insert(object_path.path(), monitor);
566
567 const QVariantMap ifaceValues = interfaces_and_properties.value(QStringLiteral("org.bluez.Device1"));
568 if (ifaceValues.value(QStringLiteral("Connected"), false).toBool()) {
569 QBluetoothAddress address(ifaceValues.value(QStringLiteral("Address")).toString());
570 connectedDevicesSet.insert(address);
572 }
573 }
574 }
575
576 if (pairingDiscoveryTimer && pairingDiscoveryTimer->isActive()
577 && interfaces_and_properties.contains(QStringLiteral("org.bluez.Device1"))) {
578 //device discovery for pairing found new remote device
580 object_path.path(), QDBusConnection::systemBus());
581 if (!address.isNull() && address == QBluetoothAddress(device.address()))
582 processPairing(object_path.path(), pairing);
583 }
584}
585
586void QBluetoothLocalDevicePrivate::InterfacesRemoved(const QDBusObjectPath &object_path,
587 const QStringList &interfaces)
588{
589 if (deviceChangeMonitors.contains(object_path.path())
590 && interfaces.contains(QLatin1String("org.bluez.Device1"))) {
591
592 if (objectPathIsForThisDevice(deviceAdapterPath, object_path.path())) {
593 //a device was removed
594 delete deviceChangeMonitors.take(object_path.path());
595
596 //the path contains the address (e.g.: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX)
597 //-> use it to update current list of connected devices
598 QString addressString = object_path.path().right(17);
599 addressString.replace(QStringLiteral("_"), QStringLiteral(":"));
600 const QBluetoothAddress address(addressString);
601 bool found = connectedDevicesSet.remove(address);
602 if (found)
604 }
605 }
606
607 if (adapter && object_path.path() == adapter->path()
608 && interfaces.contains(QLatin1String("org.bluez.Adapter1"))) {
609 qCDebug(QT_BT_BLUEZ) << "Adapter" << adapter->path() << "was removed";
610 // current adapter was removed -> invalidate the instance
611 delete adapter;
612 adapter = nullptr;
614 manager = nullptr;
615 delete adapterProperties;
616 adapterProperties = nullptr;
617
618 delete pairingTarget;
619 pairingTarget = nullptr;
620
621 // turn off connectivity monitoring
622 qDeleteAll(deviceChangeMonitors);
623 deviceChangeMonitors.clear();
624 connectedDevicesSet.clear();
625 }
626}
627
629{
630 return adapter && manager;
631}
632
633QList<QBluetoothAddress> QBluetoothLocalDevicePrivate::connectedDevices() const
634{
635 return connectedDevicesSet.values();
636}
637
638void QBluetoothLocalDevicePrivate::pairingCompleted(QDBusPendingCallWatcher *watcher)
639{
642
643 if (reply.isError()) {
644 qCWarning(QT_BT_BLUEZ) << "Failed to create pairing" << reply.error().name();
645 const bool canceledByUs =
646 (reply.error().name() == QStringLiteral("org.bluez.Error.AuthenticationCanceled"))
647 && pairingRequestCanceled;
648 if (!canceledByUs)
650
651 pairingRequestCanceled = false;
652 watcher->deleteLater();
653 return;
654 }
655
656 pairingRequestCanceled = false;
657
658 if (adapter) {
659 if (!pairingTarget) {
660 qCWarning(QT_BT_BLUEZ) << "Pairing target expected but found null pointer.";
662 watcher->deleteLater();
663 return;
664 }
665
666 if (!pairingTarget->paired()) {
667 qCWarning(QT_BT_BLUEZ) << "Device was not paired as requested";
669 watcher->deleteLater();
670 return;
671 }
672
673 const QBluetoothAddress targetAddress(pairingTarget->address());
674
675 if (pairing == QBluetoothLocalDevice::AuthorizedPaired && !pairingTarget->trusted())
676 pairingTarget->setTrusted(true);
677 else if (pairing == QBluetoothLocalDevice::Paired && pairingTarget->trusted())
678 pairingTarget->setTrusted(false);
679
680 delete pairingTarget;
681 pairingTarget = nullptr;
682
683 emit q->pairingFinished(targetAddress, pairing);
684 }
685
686 watcher->deleteLater();
687}
688
690
691#include "moc_qbluetoothlocaldevice_p.cpp"
QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok=nullptr)
QMap< QDBusObjectPath, InterfaceList > ManagedObjectList
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
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.
static QDBusConnection systemBus()
Returns a QDBusConnection object opened with the system bus.
\inmodule QtDBus
\inmodule QtDBus
void finished(QDBusPendingCallWatcher *self=nullptr)
This signal is emitted when the pending call has finished and its reply is available.
Definition qmap.h:187
T value(const Key &key, const T &defaultValue=T()) const
Definition qmap.h:357
NetworkError error() const
Returns the error that was found during the processing of this request.
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
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:2658
void deleteLater()
\threadsafe
Definition qobject.cpp:2435
const_iterator constBegin() const noexcept
Definition qset.h:139
const_iterator constEnd() const noexcept
Definition qset.h:143
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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:5455
QString & replace(qsizetype i, qsizetype len, QChar after)
Definition qstring.cpp:3824
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
QString right(qsizetype n) const &
Definition qstring.h:375
\inmodule QtCore
Definition qtimer.h:20
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
static QtBluezDiscoveryManager * instance()
#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:666
@ 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:63
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...
QT_BEGIN_NAMESPACE bool toBool(const QString &str)
Definition utils.h:14