Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdbusconnection.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "qdbusconnection.h"
6#include "qdbusconnection_p.h"
7
8#include <qdebug.h>
9#include <qcoreapplication.h>
10#include <qstringlist.h>
11#include <qtimer.h>
12#include <qthread.h>
13#include <QtCore/private/qlocking_p.h>
14
16#include "qdbuserror.h"
17#include "qdbusmessage.h"
18#include "qdbusmessage_p.h"
19#include "qdbusinterface_p.h"
20#include "qdbusutil_p.h"
22#include "qdbuspendingcall_p.h"
23
24#include "qdbusthreaddebug_p.h"
25
26#include <algorithm>
27
28#ifdef interface
29#undef interface
30#endif
31
32#ifndef QT_NO_DBUS
33
35
36#ifdef Q_OS_WIN
37static void preventDllUnload();
38#endif
39
41
43{
44 static_assert(int(QDBusConnection::SessionBus) + int(QDBusConnection::SystemBus) == 1);
46
47 if (!qdbus_loadLibDBus())
48 return nullptr;
49
50 // we'll start in suspended delivery mode if we're in the main thread
51 // (the event loop will resume delivery)
52 bool suspendedDelivery = qApp && qApp->thread() == QThread::currentThread();
53
54 const auto locker = qt_scoped_lock(defaultBusMutex);
55 if (defaultBuses[type])
56 return defaultBuses[type];
57
58 QString name = QStringLiteral("qt_default_session_bus");
60 name = QStringLiteral("qt_default_system_bus");
61 return defaultBuses[type] = connectToBus(type, name, suspendedDelivery);
62}
63
65{
66 return connectionHash.value(name, nullptr);
67}
68
70{
71 QDBusConnectionPrivate *d = nullptr;
72 d = connectionHash.take(name);
73 if (d && !d->ref.deref())
74 d->deleteLater();
75
76 // Static objects may be keeping the connection open.
77 // However, it is harmless to have outstanding references to a connection that is
78 // closing as long as those references will be soon dropped without being used.
79
80 // ### Output a warning if connections are being used after they have been removed.
81}
82
84{
86 this, &QDBusConnectionManager::executeConnectionRequest, Qt::BlockingQueuedConnection);
88 this, &QDBusConnectionManager::createServer, Qt::BlockingQueuedConnection);
89 moveToThread(this); // ugly, don't do this in other projects
90
91#ifdef Q_OS_WIN
92 // prevent the library from being unloaded on Windows. See comments in the function.
93 preventDllUnload();
94#endif
95 defaultBuses[0] = defaultBuses[1] = nullptr;
96 start();
97}
98
100{
101 quit();
102 wait();
103}
104
106{
107 return _q_manager();
108}
109
110Q_DBUS_EXPORT void qDBusBindToApplication();
112{
113}
114
116{
117 connectionHash[name] = c;
118 c->name = name;
119}
120
122{
123 exec();
124
125 // cleanup:
126 const auto locker = qt_scoped_lock(mutex);
127 for (QDBusConnectionPrivate *d : std::as_const(connectionHash)) {
128 if (!d->ref.deref()) {
129 delete d;
130 } else {
131 d->closeConnection();
132 d->moveToThread(nullptr); // allow it to be deleted in another thread
133 }
134 }
135 connectionHash.clear();
136
137 // allow deletion from any thread without warning
138 moveToThread(nullptr);
139}
140
142 bool suspendedDelivery)
143{
146 data.busType = type;
147 data.name = &name;
148 data.suspendedDelivery = suspendedDelivery;
149
151 if (suspendedDelivery && data.result->connection)
152 data.result->enableDispatchDelayed(qApp); // qApp was checked in the caller
153
154 return data.result;
155}
156
158{
161 data.busAddress = &address;
162 data.name = &name;
163 data.suspendedDelivery = false;
164
166 return data.result;
167}
168
170{
173 data.busAddress = &address;
174 data.name = &name;
175 data.suspendedDelivery = false;
176
178 return data.result;
179}
180
181void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::ConnectionRequestData *data)
182{
183 const auto locker = qt_scoped_lock(mutex);
184 const QString &name = *data->name;
185 QDBusConnectionPrivate *&d = data->result;
186
187 // check if the connection exists by name
188 d = connection(name);
189 if (d || name.isEmpty())
190 return;
191
193 DBusConnection *c = nullptr;
195 switch (data->type) {
197 switch (data->busType) {
199 c = q_dbus_bus_get_private(DBUS_BUS_SYSTEM, error);
200 break;
202 c = q_dbus_bus_get_private(DBUS_BUS_SESSION, error);
203 break;
205 c = q_dbus_bus_get_private(DBUS_BUS_STARTER, error);
206 break;
207 }
208 break;
209
212 c = q_dbus_connection_open_private(data->busAddress->toUtf8().constData(), error);
214 // register on the bus
215 if (!q_dbus_bus_register(c, error)) {
216 q_dbus_connection_unref(c);
217 c = nullptr;
218 }
219 }
220 break;
221 }
222
225 d->setPeer(c, error);
226 } else {
227 // create the bus service
228 // will lock in QDBusConnectionPrivate::connectRelay()
229 d->setConnection(c, error);
230 d->createBusService();
231 if (c && data->suspendedDelivery)
232 d->setDispatchEnabled(false);
233 }
234}
235
236void QDBusConnectionManager::createServer(const QString &address, void *server)
237{
240 d->setServer(static_cast<QDBusServer *>(server),
241 q_dbus_server_listen(address.toUtf8().constData(), error), error);
242}
243
367{
368 if (name.isEmpty() || _q_manager.isDestroyed()) {
369 d = nullptr;
370 } else {
371 const auto locker = qt_scoped_lock(_q_manager()->mutex);
372 d = _q_manager()->connection(name);
373 if (d)
374 d->ref.ref();
375 }
376}
377
382{
383 d = other.d;
384 if (d)
385 d->ref.ref();
386}
387
393{
394 d = dd;
395 if (d)
396 d->ref.ref();
397}
398
404{
405 if (d && !d->ref.deref())
406 d->deleteLater();
407}
408
417{
418 if (other.d)
419 other.d->ref.ref();
420 if (d && !d->ref.deref())
421 d->deleteLater();
422 d = other.d;
423 return *this;
424}
425
432{
433 if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
434 QDBusConnectionPrivate *d = nullptr;
435 return QDBusConnection(d);
436 }
437 return QDBusConnection(_q_manager()->connectToBus(type, name, false));
438}
439
445 const QString &name)
446{
447 if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
448 QDBusConnectionPrivate *d = nullptr;
449 return QDBusConnection(d);
450 }
451 return QDBusConnection(_q_manager()->connectToBus(address, name));
452}
460 const QString &name)
461{
462 if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
463 QDBusConnectionPrivate *d = nullptr;
464 return QDBusConnection(d);
465 }
466 return QDBusConnection(_q_manager()->connectToPeer(address, name));
467}
468
478{
479 if (_q_manager()) {
480 const auto locker = qt_scoped_lock(_q_manager()->mutex);
481 QDBusConnectionPrivate *d = _q_manager()->connection(name);
482 if (d && d->mode != QDBusConnectionPrivate::ClientMode)
483 return;
484 _q_manager()->removeConnection(name);
485 }
486}
487
499{
500 if (_q_manager()) {
501 const auto locker = qt_scoped_lock(_q_manager()->mutex);
502 QDBusConnectionPrivate *d = _q_manager()->connection(name);
503 if (d && d->mode != QDBusConnectionPrivate::PeerMode)
504 return;
505 _q_manager()->removeConnection(name);
506 }
507}
508
517{
518 if (!d || !d->connection) {
521 if (d)
522 d->lastError = err;
523 return false;
524 }
525 return d->send(message);
526}
527
548 const char *returnMethod, const char *errorMethod,
549 int timeout) const
550{
551 if (!d || !d->connection) {
554 if (d)
555 d->lastError = err;
556 return false;
557 }
558 return d->sendWithReplyAsync(message, receiver, returnMethod, errorMethod, timeout) != nullptr;
559}
560
579 const char *returnMethod, int timeout) const
580{
581 return callWithCallback(message, receiver, returnMethod, nullptr, timeout);
582}
583
608{
609 if (!d || !d->connection) {
612 if (d)
613 d->lastError = err;
614
615 return QDBusMessage::createError(err);
616 }
617
618 if (mode != QDBus::NoBlock)
619 return d->sendWithReply(message, mode, timeout);
620
621 d->send(message);
622 QDBusMessage retval;
623 retval << QVariant(); // add one argument (to avoid .at(0) problems)
624 return retval;
625}
626
645{
646 if (!d || !d->connection) {
647 return QDBusPendingCall(nullptr); // null pointer -> disconnected
648 }
649
650 QDBusPendingCallPrivate *priv = d->sendWithReplyAsync(message, nullptr, nullptr, nullptr, timeout);
651 return QDBusPendingCall(priv);
652}
653
665bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface,
666 const QString &name, QObject *receiver, const char *slot)
667{
668 return connect(service, path, interface, name, QStringList(), QString(), receiver, slot);
669}
670
688bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface,
689 const QString &name, const QString &signature,
690 QObject *receiver, const char *slot)
691{
692 return connect(service, path, interface, name, QStringList(), signature, receiver, slot);
693}
694
718bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface,
719 const QString &name, const QStringList &argumentMatch, const QString &signature,
720 QObject *receiver, const char *slot)
721{
722
723 if (!receiver || !slot || !d || !d->connection)
724 return false;
725 if (interface.isEmpty() && name.isEmpty())
726 return false;
728#ifndef QT_NO_DEBUG
729 qWarning("QDBusConnection::connect: interface name '%s' is not valid", interface.toLatin1().constData());
730#endif
731 return false;
732 }
733 if (!service.isEmpty() && !QDBusUtil::isValidBusName(service)) {
734#ifndef QT_NO_DEBUG
735 qWarning("QDBusConnection::connect: service name '%s' is not valid", service.toLatin1().constData());
736#endif
737 return false;
738 }
739 if (!path.isEmpty() && !QDBusUtil::isValidObjectPath(path)) {
740#ifndef QT_NO_DEBUG
741 qWarning("QDBusConnection::connect: object path '%s' is not valid", path.toLatin1().constData());
742#endif
743 return false;
744 }
745
746 return d->connectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot);
747}
748
757 const QString &name, QObject *receiver, const char *slot)
758{
759 return disconnect(service, path, interface, name, QStringList(), QString(), receiver, slot);
760}
761
773 const QString &name, const QString &signature,
774 QObject *receiver, const char *slot)
775{
776 return disconnect(service, path, interface, name, QStringList(), signature, receiver, slot);
777}
778
791 const QString &name, const QStringList &argumentMatch, const QString &signature,
792 QObject *receiver, const char *slot)
793{
794 if (!receiver || !slot || !d || !d->connection)
795 return false;
797 return false;
798 if (interface.isEmpty() && name.isEmpty())
799 return false;
800
801 return d->disconnectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot);
802}
803
820bool QDBusConnection::registerObject(const QString &path, QObject *object, RegisterOptions options)
821{
822 return registerObject(path, QString(), object, options);
823}
824
844bool QDBusConnection::registerObject(const QString &path, const QString &interface, QObject *object, RegisterOptions options)
845{
846 Q_ASSERT_X(QDBusUtil::isValidObjectPath(path), "QDBusConnection::registerObject",
847 "Invalid object path given");
848 if (!d || !d->connection || !object || !options || !QDBusUtil::isValidObjectPath(path))
849 return false;
850
851 auto pathComponents = QStringView{path}.split(u'/');
852 if (pathComponents.constLast().isEmpty())
853 pathComponents.removeLast();
855
856 // lower-bound search for where this object should enter in the tree
857 QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode;
858 int i = 1;
859 while (node) {
860 if (pathComponents.size() == i) {
861 // this node exists
862 // consider it free if there's no object here and the user is not trying to
863 // replace the object sub-tree
864 if (node->obj)
865 return false;
866
868 if (options & SubPath && !node->children.isEmpty())
869 return false;
870 } else {
871 if ((options & ExportChildObjects && !node->children.isEmpty()))
872 return false;
873 }
874 // we can add the object here
875 node->obj = object;
876 node->flags = options;
877 node->interfaceName = interface;
878
879 d->registerObject(node);
880 //qDebug("REGISTERED FOR %s", path.toLocal8Bit().constData());
881 return true;
882 }
883
884 // if a virtual object occupies this path, return false
886 //qDebug("Cannot register object at %s because QDBusVirtualObject handles all sub-paths.",
887 // qPrintable(path));
888 return false;
889 }
890
891 // find the position where we'd insert the node
893 std::lower_bound(node->children.begin(), node->children.end(), pathComponents.at(i));
894 if (it != node->children.end() && it->name == pathComponents.at(i)) {
895 // match: this node exists
896 node = &(*it);
897
898 // are we allowed to go deeper?
899 if (node->flags & ExportChildObjects) {
900 // we're not
901 //qDebug("Cannot register object at %s because %s exports its own child objects",
902 // qPrintable(path), qPrintable(pathComponents.at(i)));
903 return false;
904 }
905 } else {
906 // add entry
907 it = node->children.insert(it, pathComponents.at(i).toString());
908 node = &(*it);
909 }
910
911 // iterate
912 ++i;
913 }
914
915 Q_ASSERT_X(false, "QDBusConnection::registerObject", "The impossible happened");
916 return false;
917}
918
929{
930 int opts = options | QDBusConnectionPrivate::VirtualObject;
931 return registerObject(path, (QObject*) treeNode, (RegisterOptions) opts);
932}
933
941{
942 if (!d || !d->connection || !QDBusUtil::isValidObjectPath(path))
943 return;
944
946 d->unregisterObject(path, mode);
947}
948
954{
955 Q_ASSERT_X(QDBusUtil::isValidObjectPath(path), "QDBusConnection::registeredObject",
956 "Invalid object path given");
957 if (!d || !d->connection || !QDBusUtil::isValidObjectPath(path))
958 return nullptr;
959
960 auto pathComponents = QStringView{path}.split(u'/');
961 if (pathComponents.constLast().isEmpty())
962 pathComponents.removeLast();
963
964 // lower-bound search for where this object should enter in the tree
966 const QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode;
967
968 int i = 1;
969 while (node) {
970 if (pathComponents.size() == i)
971 return node->obj;
973 return node->obj;
974
976 std::lower_bound(node->children.constBegin(), node->children.constEnd(), pathComponents.at(i));
977 if (it == node->children.constEnd() || it->name != pathComponents.at(i))
978 break; // node not found
979
980 node = &(*it);
981 ++i;
982 }
983 return nullptr;
984}
985
986
987
993{
994 if (!d || d->mode != QDBusConnectionPrivate::ClientMode)
995 return nullptr;
996 return d->busService;
997}
998
1010{
1011 return d ? d->connection : nullptr;
1012}
1013
1018{
1019 return d && d->connection && q_dbus_connection_get_is_connected(d->connection);
1020}
1021
1032{
1034}
1035
1047{
1048 return d ? d->baseService : QString();
1049}
1050
1069{
1070 return d ? d->name : QString();
1071}
1072
1080QDBusConnection::ConnectionCapabilities QDBusConnection::connectionCapabilities() const
1081{
1082 return d ? d->connectionCapabilities() : ConnectionCapabilities();
1083}
1084
1093{
1094 if (interface() && interface()->registerService(serviceName)) {
1095 if (d) d->registerService(serviceName);
1096 return true;
1097 }
1098 return false;
1099}
1100
1109{
1110 if (interface()->unregisterService(serviceName)) {
1111 if (d) d->unregisterService(serviceName);
1112 return true;
1113 }
1114 return false;
1115}
1116
1125{
1126 if (_q_manager.isDestroyed())
1127 return QDBusConnection(nullptr);
1128 return QDBusConnection(_q_manager()->busConnection(SessionBus));
1129}
1130
1139{
1140 if (_q_manager.isDestroyed())
1141 return QDBusConnection(nullptr);
1142 return QDBusConnection(_q_manager()->busConnection(SystemBus));
1143}
1144
1149{
1153 ref.deref(); // busService has increased the refcounting to us
1154 // avoid cyclic refcounting
1155
1159}
1160
1175{
1176 char *dbus_machine_id = q_dbus_get_local_machine_id();
1177 QByteArray result = dbus_machine_id;
1178 q_dbus_free(dbus_machine_id);
1179 return result;
1180}
1181
1216
1217#include "moc_qdbusconnection_p.cpp"
1218#include "moc_qdbusconnection.cpp"
1219#include "moc_qdbusconnectionmanager_p.cpp"
1220
1221#ifdef Q_OS_WIN
1222# include <qt_windows.h>
1223
1225static void preventDllUnload()
1226{
1227 // Thread termination is really wacky on Windows. For some reason we don't
1228 // understand, exiting from the thread may try to unload the DLL. Since the
1229 // QDBusConnectionManager thread runs until the DLL is unloaded, we've got
1230 // a deadlock: the main thread is waiting for the manager thread to exit,
1231 // but the manager thread is attempting to acquire a lock to unload the DLL.
1232 //
1233 // We work around the issue by preventing the unload from happening in the
1234 // first place.
1235 //
1236 // For this trick, see
1237 // https://blogs.msdn.microsoft.com/oldnewthing/20131105-00/?p=2733
1238
1239 static HMODULE self;
1240 GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
1241 GET_MODULE_HANDLE_EX_FLAG_PIN,
1242 reinterpret_cast<const wchar_t *>(&self), // any address in this DLL
1243 &self);
1244}
1246#endif
1247
1248#endif // QT_NO_DBUS
Connects to the accessibility dbus.
\inmodule QtCore
Definition qbytearray.h:57
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &call)
This signal is emitted when there is an error during a QDBusConnection::callWithCallback().
QDBusConnectionPrivate * connection(const QString &name) const
static QDBusConnectionManager * instance()
void serverRequested(const QString &address, void *server)
void connectionRequested(ConnectionRequestData *)
void removeConnection(const QString &name)
void setConnection(const QString &name, QDBusConnectionPrivate *c)
QDBusConnectionPrivate * connectToPeer(const QString &address, const QString &name)
QDBusConnectionPrivate * connectToBus(QDBusConnection::BusType type, const QString &name, bool suspendedDelivery)
QDBusConnectionInterface * busService
DBusConnection * connection
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &message)
\inmodule QtDBus
bool send(const QDBusMessage &message) const
Sends the message over this connection, without waiting for a reply.
static QDBusConnection systemBus()
Returns a QDBusConnection object opened with the system bus.
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
Disconnects the signal specified by the service, path, interface and name parameters from the slot sl...
void * internalPointer() const
bool registerVirtualObject(const QString &path, QDBusVirtualObject *object, VirtualObjectRegisterOption options=SingleNode)
static QByteArray localMachineId()
static QDBusConnection connectToPeer(const QString &address, const QString &name)
QDBusConnection(const QString &name)
Creates a QDBusConnection object attached to the connection with name name.
bool callWithCallback(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout=-1) const
Sends the message over this connection and returns immediately.
BusType
Specifies the type of the bus connection.
QDBusConnectionInterface * interface() const
Returns a QDBusConnectionInterface object that represents the D-Bus server interface on this connecti...
bool unregisterService(const QString &serviceName)
Unregisters the service serviceName that was previously registered with registerService() and returns...
bool isConnected() const
Returns true if this QDBusConnection object is connected.
static QDBusConnection connectToBus(BusType type, const QString &name)
Opens a connection of type type to one of the known buses and associate with it the connection name n...
ConnectionCapabilities connectionCapabilities() const
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode=QDBus::Block, int timeout=-1) const
Sends the message over this connection and blocks, waiting for a reply, for at most timeout milliseco...
QString name() const
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
Connects the signal specified by the service, path, interface and name parameters to the slot slot in...
static QDBusConnection sessionBus()
Returns a QDBusConnection object opened with the session bus.
static void disconnectFromPeer(const QString &name)
static void disconnectFromBus(const QString &name)
Closes the bus connection of name name.
~QDBusConnection()
Disposes of this object.
UnregisterMode
The mode for unregistering an object path:
bool registerService(const QString &serviceName)
Attempts to register the serviceName on the D-Bus server and returns true if the registration succeed...
QObject * objectRegisteredAt(const QString &path) const
Return the object that was registered with the registerObject() at the object path given by path.
void unregisterObject(const QString &path, UnregisterMode mode=UnregisterNode)
Unregisters an object that was registered with the registerObject() at the object path given by path ...
QString baseService() const
Returns the unique connection name for this connection, if this QDBusConnection object is connected,...
QDBusPendingCall asyncCall(const QDBusMessage &message, int timeout=-1) const
bool registerObject(const QString &path, QObject *object, RegisterOptions options=ExportAdaptors)
Registers the object object at path path and returns true if the registration was successful.
QDBusError lastError() const
Returns the last error that happened in this connection.
QDBusConnection & operator=(QDBusConnection &&other) noexcept
\inmodule QtDBus
Definition qdbuserror.h:21
\inmodule QtDBus
static QDBusMessage createError(const QString &name, const QString &msg)
Constructs a new DBus message representing an error, with the given name and msg.
\inmodule QtDBus
\inmodule QtDBus
Definition qdbusserver.h:21
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
Definition qhash.h:975
T value(const Key &key) const noexcept
Definition qhash.h:1044
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
Definition qhash.h:949
bool isEmpty() const noexcept
Definition qlist.h:390
iterator insert(qsizetype i, parameter_type t)
Definition qlist.h:471
iterator end()
Definition qlist.h:609
const_iterator constBegin() const noexcept
Definition qlist.h:615
iterator begin()
Definition qlist.h:608
void removeLast() noexcept
Definition qlist.h:808
const_iterator constEnd() const noexcept
Definition qlist.h:616
const_iterator ConstIterator
Definition qlist.h:251
\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
\inmodule QtCore
\inmodule QtCore
Definition qstringview.h:76
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
Definition qstring.cpp:7987
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
static QThread * currentThread()
Definition qthread.cpp:966
\inmodule QtCore
Definition qvariant.h:64
@ DBUS_BUS_SESSION
@ DBUS_BUS_STARTER
@ DBUS_BUS_SYSTEM
QSet< QString >::iterator it
bool isValidInterfaceName(const QString &ifaceName)
Returns true if this is ifaceName is a valid interface name.
bool isValidBusName(const QString &busName)
Returns true if busName is a valid bus name.
bool isValidObjectPath(const QString &path)
Returns true if path is valid object path.
QString disconnectedErrorMessage()
CallMode
This enum describes the various ways of placing a function call.
Combined button and popup list for selecting options.
@ BlockingQueuedConnection
@ QueuedConnection
#define qApp
bool qdbus_loadLibDBus()
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 const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall DBusPendingCall return DBusPendingCall return dbus_int32_t return DBusServer * server
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
DBusConnection const char DBusError * error
DBusConnection * connection
Q_DBUS_EXPORT void qDBusBindToApplication()
@ ObjectRegisteredAtAction
@ UnregisterObjectAction
@ RegisterObjectAction
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#define qWarning
Definition qlogging.h:162
static const QMetaObjectPrivate * priv(const uint *data)
GLenum mode
GLuint object
[3]
GLbitfield GLuint64 timeout
[4]
GLenum type
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint start
GLint ref
GLuint name
const GLubyte * c
GLuint GLuint64EXT address
GLsizei const GLchar *const * path
GLuint64EXT * result
[6]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define Q_ASSERT_X(cond, x, msg)
Definition qrandom.cpp:48
#define QStringLiteral(str)
#define emit
HINSTANCE HMODULE
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]
myObject moveToThread(QApplication::instance() ->thread())
[6]
QMutex mutex
[2]
QReadWriteLock lock
[0]
QSharedPointer< T > other(t)
[5]
dialog exec()