Qt 4.8
Public Functions | Properties | List of all members
QDBusDefaultConnection Class Reference
Inheritance diagram for QDBusDefaultConnection:
QDBusConnection

Public Functions

 QDBusDefaultConnection (BusType type, const char *name)
 
 ~QDBusDefaultConnection ()
 
- Public Functions inherited from QDBusConnection
QDBusPendingCall asyncCall (const QDBusMessage &message, int timeout=-1) const
 Sends the message over this connection and returns immediately. More...
 
QString baseService () const
 Returns the unique connection name for this connection, if this QDBusConnection object is connected, or an empty QString otherwise. More...
 
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 milliseconds. More...
 
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. More...
 
bool callWithCallback (const QDBusMessage &message, QObject *receiver, const char *slot, int timeout=-1) const
 Sends the message over this connection and returns immediately. More...
 
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 object receiver. More...
 
bool connect (const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, QObject *receiver, const char *slot)
 Connects the signal to the slot slot in object receiver. More...
 
bool connect (const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)
 Connects the signal to the slot slot in object receiver. More...
 
ConnectionCapabilities connectionCapabilities () const
 Returns the capabilities of this connection as negotiated with the bus server or peer. More...
 
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 slot in object receiver. More...
 
bool disconnect (const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, QObject *receiver, const char *slot)
 Disconnects the signal specified by the service, path, interface, name, and signature parameters from the slot slot in object receiver. More...
 
bool disconnect (const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)
 Disconnects the signal specified by the service, path, interface, name, argumentMatch, and signature parameters from the slot slot in object receiver. More...
 
QDBusConnectionInterfaceinterface () const
 Returns a QDBusConnectionInterface object that represents the D-Bus server interface on this connection. More...
 
void * internalPointer () const
 
bool isConnected () const
 Returns true if this QDBusConnection object is connected. More...
 
QDBusError lastError () const
 Returns the last error that happened in this connection. More...
 
QString name () const
 Returns the connection name for this connection, as given as the name parameter to connectToBus(). More...
 
QObjectobjectRegisteredAt (const QString &path) const
 Return the object that was registered with the registerObject() at the object path given by path. More...
 
QDBusConnectionoperator= (const QDBusConnection &other)
 Creates a copy of the connection other in this object. More...
 
 QDBusConnection (const QString &name)
 Creates a QDBusConnection object attached to the connection with name name. More...
 
 QDBusConnection (const QDBusConnection &other)
 Creates a copy of the other connection. More...
 
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. More...
 
bool registerService (const QString &serviceName)
 Attempts to register the serviceName on the D-Bus server and returns true if the registration succeeded. More...
 
bool registerVirtualObject (const QString &path, QDBusVirtualObject *object, VirtualObjectRegisterOption options=SingleNode)
 Registers a QDBusTreeNode for a path. More...
 
bool send (const QDBusMessage &message) const
 Sends the message over this connection, without waiting for a reply. More...
 
void unregisterObject (const QString &path, UnregisterMode mode=UnregisterNode)
 Unregisters an object that was registered with the registerObject() at the object path given by path and, if mode is QDBusConnection::UnregisterTree, all of its sub-objects too. More...
 
bool unregisterService (const QString &serviceName)
 Unregisters the service serviceName that was previously registered with registerService() and returns true if it succeeded. More...
 
 ~QDBusConnection ()
 Disposes of this object. More...
 

Properties

const char * ownName
 

Additional Inherited Members

- Public Types inherited from QDBusConnection
enum  BusType { SessionBus, SystemBus, ActivationBus }
 Specifies the type of the bus connection. More...
 
enum  ConnectionCapability { UnixFileDescriptorPassing = 0x0001 }
 This enum describes the available capabilities for a D-Bus connection. More...
 
enum  RegisterOption {
  ExportAdaptors = 0x01, ExportScriptableSlots = 0x10, ExportScriptableSignals = 0x20, ExportScriptableProperties = 0x40,
  ExportScriptableInvokables = 0x80, ExportScriptableContents = 0xf0, ExportNonScriptableSlots = 0x100, ExportNonScriptableSignals = 0x200,
  ExportNonScriptableProperties = 0x400, ExportNonScriptableInvokables = 0x800, ExportNonScriptableContents = 0xf00, ExportAllSlots = ExportScriptableSlots|ExportNonScriptableSlots,
  ExportAllSignals = ExportScriptableSignals|ExportNonScriptableSignals, ExportAllProperties = ExportScriptableProperties|ExportNonScriptableProperties, ExportAllInvokables = ExportScriptableInvokables|ExportNonScriptableInvokables, ExportAllContents = ExportScriptableContents|ExportNonScriptableContents,
  ExportChildObjects = 0x1000
}
 Specifies the options for registering objects with the connection. More...
 
enum  UnregisterMode { UnregisterNode, UnregisterTree }
 The mode for unregistering an object path: More...
 
enum  VirtualObjectRegisterOption { SingleNode = 0x0, SubPath = 0x1 }
 Specifies the options for registering virtual objects with the connection. More...
 
- Static Public Functions inherited from QDBusConnection
static QDBusConnection connectToBus (BusType type, const QString &name)
 Opens a connection of type type to one of the known busses and associate with it the connection name name. More...
 
static QDBusConnection connectToBus (const QString &address, const QString &name)
 Opens a connection to a private bus on address address and associate with it the connection name name. More...
 
static QDBusConnection connectToPeer (const QString &address, const QString &name)
 Opens a peer-to-peer connection on address address and associate with it the connection name name. More...
 
static void disconnectFromBus (const QString &name)
 Closes the bus connection of name name. More...
 
static void disconnectFromPeer (const QString &name)
 Closes the peer connection of name name. More...
 
static QByteArray localMachineId ()
 Returns the local machine ID as known to the D-Bus system. More...
 
static QDBusConnection sender ()
 Returns the connection that sent the signal, if called in a slot activated by QDBus; otherwise it returns 0. More...
 
static QDBusConnection sessionBus ()
 Returns a QDBusConnection object opened with the session bus. More...
 
static QDBusConnection systemBus ()
 Returns a QDBusConnection object opened with the system bus. More...
 
- Protected Functions inherited from QDBusConnection
 QDBusConnection (QDBusConnectionPrivate *dd)
 Creates a connection object with the given dd as private object. More...
 

Detailed Description

Definition at line 1163 of file qdbusconnection.cpp.

Constructors and Destructors

◆ QDBusDefaultConnection()

QDBusDefaultConnection::QDBusDefaultConnection ( BusType  type,
const char *  name 
)
inline

Definition at line 1167 of file qdbusconnection.cpp.

1169  {
1170  // make sure this connection is running on the main thread
1172  if (!instance) {
1173  qWarning("QDBusConnection: %s D-Bus connection created before QCoreApplication. Application may misbehave.",
1174  type == SessionBus ? "session" : type == SystemBus ? "system" : "generic");
1175  } else if (QDBusConnectionPrivate::d(*this)) {
1176  QDBusConnectionPrivate::d(*this)->moveToThread(instance->thread());
1177  }
1178  }
int type
Definition: qmetatype.cpp:239
static QDBusConnectionPrivate * d(const QDBusConnection &q)
QString name() const
Returns the connection name for this connection, as given as the name parameter to connectToBus()...
QDBusConnection(const QString &name)
Creates a QDBusConnection object attached to the connection with name name.
Q_CORE_EXPORT void qWarning(const char *,...)
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
Definition: qobject.cpp:1458
The QCoreApplication class provides an event loop for console Qt applications.
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static QDBusConnection connectToBus(BusType type, const QString &name)
Opens a connection of type type to one of the known busses and associate with it the connection name ...
QThread * thread() const
Returns the thread in which the object lives.
Definition: qobject.cpp:1419

◆ ~QDBusDefaultConnection()

QDBusDefaultConnection::~QDBusDefaultConnection ( )
inline

Definition at line 1180 of file qdbusconnection.cpp.

static void disconnectFromBus(const QString &name)
Closes the bus connection of name name.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

Properties

◆ ownName

const char* QDBusDefaultConnection::ownName
private

Definition at line 1165 of file qdbusconnection.cpp.


The documentation for this class was generated from the following file: