PySide6.QtDBus.QDBusConnectionInterface¶
- class QDBusConnectionInterface¶
- The - QDBusConnectionInterfaceclass provides access to the D-Bus bus daemon service. More…- Synopsis¶- Methods¶
- def - serviceOwner()
- def - servicePid()
- def - serviceUid()
- def - startService()
 - Signals¶- def - NameAcquired()
- def - NameLost()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- The D-Bus bus server daemon provides one special interface - org.freedesktop.DBusthat allows clients to access certain properties of the bus, such as the current list of clients connected. The- QDBusConnectionInterfaceclass 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 serviceOwnerChanged() signals.- class 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 
 - class ServiceReplacementOptions¶
- Flags for determining if the D-Bus server should allow another application to replace a name that this application has registered with the - ReplaceExistingServiceoption.- 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 - ReplaceExistingServiceoption to- registerService()without intervention. If that happens, the- serviceUnregistered()signal will be emitted.- See also 
 - class 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 - QueueServiceflag 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.
 - NameAcquired(arg__1)¶
- Parameters:
- arg__1 – str 
 
 - NameLost(arg__1)¶
- Parameters:
- arg__1 – str 
 
 - NameOwnerChanged(arg__1, arg__2, arg__3)¶
- Parameters:
- arg__1 – str 
- arg__2 – str 
- arg__3 – str 
 
 
 - activatableServiceNames()¶
- Return type:
- QDBusReply
 
 - callWithCallbackFailed(error, call)¶
- Parameters:
- error – - QDBusError
- call – - QDBusMessage
 
 
 - This signal is emitted when there is an error during a - callWithCallback().- errorspecifies the error.- callis the message that couldn’t be delivered.- See also - isServiceRegistered(serviceName)¶
- Parameters:
- serviceName – str 
- Return type:
- QDBusReply
 
 - Returns - trueif the service name- serviceNamehas is currently registered.- registerService(serviceName, qoption, roption)¶
- Parameters:
- serviceName – str 
- qoption – - ServiceQueueOptions
- roption – - ServiceReplacementOptions
 
- Return type:
- QDBusReply
 
 - Requests to register the service name - serviceNameon the bus. The- qoptionflag specifies how the D-Bus server should behave if- serviceNameis already registered. The- roptionflag 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- roptionis- AllowReplacement, the- serviceUnregistered()signal will be emitted if another application replaces this one.- See also - registeredServiceNames()¶
- Return type:
- QDBusReply
 
 - serviceOwner(name)¶
- Parameters:
- name – 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.NameHasNoOwnererror.- serviceOwnerChanged(name, oldOwner, newOwner)¶
- Parameters:
- name – str 
- oldOwner – str 
- newOwner – str 
 
 
 - Use - QDBusServiceWatcherinstead.- This signal is emitted by the D-Bus server whenever a service ownership change happens in the bus, including apparition and disparition of names. - This signal means the application - oldOwnerlost ownership of bus name- nameto application- newOwner. If- oldOwneris an empty string, it means the name- namehas just been created; if- newOwneris empty, the name- namehas no current owner and is no longer available.- Note - connecting to this signal will make the application listen for and receive every single service ownership change on the bus. Depending on how many services are running, this make the application be activated to receive more signals than it needs. To avoid this problem, use the - QDBusServiceWatcherclass, which can listen for specific changes.- servicePid(serviceName)¶
- Parameters:
- serviceName – str 
- Return type:
- QDBusReply
 
 - Returns the Unix Process ID (PID) for the process currently holding the bus service - serviceName.- serviceRegistered(service)¶
- Parameters:
- service – str 
 
 - This signal is emitted by the D-Bus server when the bus service name (unique connection name or well-known service name) given by - serviceis acquired by this application.- Acquisition happens after this application has requested a name using - registerService().- serviceUid(serviceName)¶
- Parameters:
- serviceName – str 
- Return type:
- QDBusReply
 
 - Returns the Unix User ID (UID) for the process currently holding the bus service - serviceName.- serviceUnregistered(service)¶
- Parameters:
- service – str 
 
 - This signal is emitted by the D-Bus server when this application loses ownership of the bus service name given by - service.- startService(name)¶
- Parameters:
- name – str 
- Return type:
- QDBusReply
 
 - Requests that the bus start the service given by the name - name.- unregisterService(serviceName)¶
- Parameters:
- serviceName – 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.