QDBusConnectionInterface¶
The QDBusConnectionInterface
class provides access to the D-Bus bus daemon service. More…
Synopsis¶
Functions¶
def
activatableServiceNames
()def
isServiceRegistered
(arg__1)def
registerService
(arg__1, arg__2, arg__3)def
registeredServiceNames
()def
serviceOwner
(arg__1)def
servicePid
(arg__1)def
serviceUid
(arg__1)def
startService
(arg__1)def
unregisterService
(arg__1)
Signals¶
def
NameAcquired
(arg__1)def
NameLost
(arg__1)def
NameOwnerChanged
(arg__1, arg__2, arg__3)def
callWithCallbackFailed
(error, call)def
serviceOwnerChanged
(name, oldOwner, newOwner)def
serviceRegistered
(service)def
serviceUnregistered
(service)
Detailed Description¶
The D-Bus bus server daemon provides one special interface org.freedesktop.DBus
that allows clients to access certain properties of the bus, such as the current list of clients connected. The QDBusConnectionInterface
class provides access to that interface.
The most common uses of this class are to register and unregister service names on the bus using the registerService()
and unregisterService()
functions, query about existing names using the isServiceRegistered()
, registeredServiceNames()
and serviceOwner()
functions, and to receive notification that a client has registered or de-registered through the serviceRegistered()
, serviceUnregistered()
and signals.
- class PySide6.QtDBus.QDBusConnectionInterface¶
- PySide6.QtDBus.QDBusConnectionInterface.ServiceQueueOptions¶
Flags for determining how a service registration should behave, in case the service name is already registered.
Constant
Description
QDBusConnectionInterface.DontQueueService
If an application requests a name that is already owned, no queueing will be performed. The registeredService() call will simply fail. This is the default.
QDBusConnectionInterface.QueueService
Attempts to register the requested service, but do not try to replace it if another application already has it registered. Instead, simply put this application in queue, until it is given up. The
serviceRegistered()
signal will be emitted when that happens.QDBusConnectionInterface.ReplaceExistingService
If another application already has the service name registered, attempt to replace it.
See also
ServiceReplacementOptions
- PySide6.QtDBus.QDBusConnectionInterface.ServiceReplacementOptions¶
Flags for determining if the D-Bus server should allow another application to replace a name that this application has registered with the ReplaceExistingService
option.
The possible values are:
Constant
Description
QDBusConnectionInterface.DontAllowReplacement
Do not allow another application to replace us. The service must be explicitly unregistered with
unregisterService()
for another application to acquire it. This is the default.QDBusConnectionInterface.AllowReplacement
Allow other applications to replace us with the
ReplaceExistingService
option toregisterService()
without intervention. If that happens, theserviceUnregistered()
signal will be emitted.See also
ServiceQueueOptions
- PySide6.QtDBus.QDBusConnectionInterface.RegisterServiceReply¶
The possible return values from registerService()
:
Constant
Description
QDBusConnectionInterface.ServiceNotRegistered
The call failed and the service name was not registered.
QDBusConnectionInterface.ServiceRegistered
The caller is now the owner of the service name.
QDBusConnectionInterface.ServiceQueued
The caller specified the
QueueService
flag and the service was already registered, so we are in queue.
The serviceRegistered()
signal will be emitted when the service is acquired by this application.
- PySide6.QtDBus.QDBusConnectionInterface.NameAcquired(arg__1)¶
- Parameters
arg__1 – str
- PySide6.QtDBus.QDBusConnectionInterface.NameLost(arg__1)¶
- Parameters
arg__1 – str
- PySide6.QtDBus.QDBusConnectionInterface.NameOwnerChanged(arg__1, arg__2, arg__3)¶
- Parameters
arg__1 – str
arg__2 – str
arg__3 – str
- PySide6.QtDBus.QDBusConnectionInterface.activatableServiceNames()¶
- Return type
QDBusReply
- PySide6.QtDBus.QDBusConnectionInterface.callWithCallbackFailed(error, call)¶
- Parameters
error –
PySide6.QtDBus.QDBusError
call –
PySide6.QtDBus.QDBusMessage
- PySide6.QtDBus.QDBusConnectionInterface.isServiceRegistered(arg__1)¶
- Parameters
arg__1 – str
- Return type
QDBusReply
Returns true
if the service name serviceName
has is currently registered.
- PySide6.QtDBus.QDBusConnectionInterface.registerService(arg__1, arg__2, arg__3)¶
- Parameters
arg__1 – str
arg__2 –
ServiceQueueOptions
arg__3 –
ServiceReplacementOptions
- Return type
QDBusReply
Requests to register the service name serviceName
on the bus. The qoption
flag specifies how the D-Bus server should behave if serviceName
is already registered. The roption
flag specifies if the server should allow another application to replace our registered name.
If the service registration succeeds, the serviceRegistered()
signal will be emitted. If we are placed in queue, the signal will be emitted when we obtain the name. If roption
is AllowReplacement
, the serviceUnregistered()
signal will be emitted if another application replaces this one.
See also
- PySide6.QtDBus.QDBusConnectionInterface.registeredServiceNames()¶
- Return type
QDBusReply
- PySide6.QtDBus.QDBusConnectionInterface.serviceOwner(arg__1)¶
- Parameters
arg__1 – str
- Return type
QDBusReply
Returns the unique connection name of the primary owner of the name name
. If the requested name doesn’t have an owner, returns a org.freedesktop.DBus.Error.NameHasNoOwner
error.
- PySide6.QtDBus.QDBusConnectionInterface.serviceOwnerChanged(name, oldOwner, newOwner)¶
- Parameters
name – str
oldOwner – str
newOwner – str
- PySide6.QtDBus.QDBusConnectionInterface.servicePid(arg__1)¶
- Parameters
arg__1 – str
- Return type
QDBusReply
Returns the Unix Process ID (PID) for the process currently holding the bus service serviceName
.
- PySide6.QtDBus.QDBusConnectionInterface.serviceRegistered(service)¶
- Parameters
service – str
- PySide6.QtDBus.QDBusConnectionInterface.serviceUid(arg__1)¶
- Parameters
arg__1 – str
- Return type
QDBusReply
Returns the Unix User ID (UID) for the process currently holding the bus service serviceName
.
- PySide6.QtDBus.QDBusConnectionInterface.serviceUnregistered(service)¶
- Parameters
service – str
- PySide6.QtDBus.QDBusConnectionInterface.startService(arg__1)¶
- Parameters
arg__1 – str
- Return type
QDBusReply
Requests that the bus start the service given by the name name
.
- PySide6.QtDBus.QDBusConnectionInterface.unregisterService(arg__1)¶
- Parameters
arg__1 – str
- Return type
QDBusReply
Releases the claim on the bus service name serviceName
, that had been previously registered with registerService()
. If this application had ownership of the name, it will be released for other applications to claim. If it only had the name queued, it gives up its position in the queue.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.