Qt 4.8
Public Functions | Public Variables | List of all members
QDBusInterfacePrivate Class Reference

#include <qdbusinterface_p.h>

Inheritance diagram for QDBusInterfacePrivate:
QDBusAbstractInterfacePrivate QObjectPrivate QObjectData

Public Functions

int metacall (QMetaObject::Call c, int id, void **argv)
 
 QDBusInterfacePrivate (const QString &serv, const QString &p, const QString &iface, const QDBusConnection &con)
 
 ~QDBusInterfacePrivate ()
 
- Public Functions inherited from QDBusAbstractInterfacePrivate
void _q_serviceOwnerChanged (const QString &name, const QString &oldOwner, const QString &newOwner)
 
bool canMakeCalls () const
 
QDBusConnectionPrivateconnectionPrivate () const
 
void property (const QMetaProperty &mp, QVariant &where) const
 
 QDBusAbstractInterfacePrivate (const QString &serv, const QString &p, const QString &iface, const QDBusConnection &con, bool dynamic)
 
bool setProperty (const QMetaProperty &mp, const QVariant &value)
 
virtual ~QDBusAbstractInterfacePrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

QDBusMetaObjectmetaObject
 
- Public Variables inherited from QDBusAbstractInterfacePrivate
QDBusConnection connection
 
QString currentOwner
 
QString interface
 
bool isValid
 
QDBusError lastError
 
QString path
 
QString service
 
int timeout
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Detailed Description

Definition at line 65 of file qdbusinterface_p.h.

Constructors and Destructors

◆ QDBusInterfacePrivate()

QDBusInterfacePrivate::QDBusInterfacePrivate ( const QString serv,
const QString p,
const QString iface,
const QDBusConnection con 
)

Definition at line 152 of file qdbusinterface.cpp.

154  : QDBusAbstractInterfacePrivate(serv, p, iface, con, true), metaObject(0)
155 {
156  // QDBusAbstractInterfacePrivate's constructor checked the parameters for us
157  if (connection.isConnected()) {
159 
160  if (!metaObject) {
161  // creation failed, somehow
162  // most common causes are that the service doesn't exist or doesn't support introspection
163  // those are not fatal errors, so we continue working
164 
165  if (!lastError.isValid())
167  }
168  }
169 }
bool isValid() const
Returns true if this is a valid error condition (i.e., if there was an error), otherwise false...
Definition: qdbuserror.cpp:356
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
Definition: qdbuserror.h:60
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QDBusAbstractInterfacePrivate(const QString &serv, const QString &p, const QString &iface, const QDBusConnection &con, bool dynamic)
QDBusMetaObject * findMetaObject(const QString &service, const QString &path, const QString &interface, QDBusError &error)
QDBusMetaObject * metaObject
bool isConnected() const
Returns true if this QDBusConnection object is connected.
QDBusConnectionPrivate * connectionPrivate() const

◆ ~QDBusInterfacePrivate()

QDBusInterfacePrivate::~QDBusInterfacePrivate ( )

Definition at line 171 of file qdbusinterface.cpp.

172 {
173  if (metaObject && !metaObject->cached)
174  delete metaObject;
175 }
QDBusMetaObject * metaObject

Functions

◆ metacall()

int QDBusInterfacePrivate::metacall ( QMetaObject::Call  c,
int  id,
void **  argv 
)

Definition at line 280 of file qdbusinterface.cpp.

281 {
283 
285  int offset = metaObject->methodOffset();
286  QMetaMethod mm = metaObject->method(id + offset);
287 
288  if (mm.methodType() == QMetaMethod::Signal) {
289  // signal relay from D-Bus world to Qt world
290  QMetaObject::activate(q, metaObject, id, argv);
291 
292  } else if (mm.methodType() == QMetaMethod::Slot || mm.methodType() == QMetaMethod::Method) {
293  // method call relay from Qt world to D-Bus world
294  // get D-Bus equivalent signature
296  const int *inputTypes = metaObject->inputTypesForMethod(id);
297  int inputTypesCount = *inputTypes;
298 
299  // we will assume that the input arguments were passed correctly
300  QVariantList args;
301  int i = 1;
302  for ( ; i <= inputTypesCount; ++i)
303  args << QVariant(inputTypes[i], argv[i]);
304 
305  // make the call
306  QDBusMessage reply = q->callWithArgumentList(QDBus::Block, methodName, args);
307 
308  if (reply.type() == QDBusMessage::ReplyMessage) {
309  // attempt to demarshall the return values
310  args = reply.arguments();
312  const int *outputTypes = metaObject->outputTypesForMethod(id);
313  int outputTypesCount = *outputTypes++;
314 
315  if (*mm.typeName()) {
316  // this method has a return type
317  if (argv[0] && it != args.constEnd())
318  copyArgument(argv[0], *outputTypes++, *it);
319 
320  // skip this argument even if we didn't copy it
321  --outputTypesCount;
322  ++it;
323  }
324 
325  for (int j = 0; j < outputTypesCount && it != args.constEnd(); ++i, ++j, ++it) {
326  copyArgument(argv[i], outputTypes[j], *it);
327  }
328  }
329 
330  // done
331  lastError = reply;
332  return -1;
333  }
334  }
335  return id;
336 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
unsigned char c[8]
Definition: qnumeric_p.h:62
#define it(className, varName)
const char * dbusNameForMethod(int id) const
static void copyArgument(void *to, int id, const QVariant &arg)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QDBusInterface class is a proxy for interfaces on remote objects.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
const char * typeName() const
Returns the return type of this method, or an empty string if the return type is void.
#define Q_Q(Class)
Definition: qglobal.h:2483
QList< QVariant > arguments() const
Returns the list of arguments that are going to be sent or were received from D-Bus.
int methodOffset() const
Returns the method offset for this class; i.e.
QDBusMetaObject * metaObject
MethodType methodType() const
Returns the type of this method (signal, slot, or method).
const int * outputTypesForMethod(int id) const
static void activate(QObject *sender, int signal_index, void **argv)
Definition: qobject.cpp:3690
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
Definition: qlist.h:279
static QByteArray methodName(const char *signature, int nameLength)
Makes a deep copy of the first nameLength characters of the given method signature and returns the co...
const int * inputTypesForMethod(int id) const
The QDBusMessage class represents one message sent or received over the D-Bus bus.
Definition: qdbusmessage.h:59
MessageType type() const
Returns the message type.
QMetaMethod method(int index) const
Returns the meta-data for the method with the given index.
The QMetaMethod class provides meta-data about a member function.
Definition: qmetaobject.h:56
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

Properties

◆ metaObject

QDBusMetaObject* QDBusInterfacePrivate::metaObject

Definition at line 70 of file qdbusinterface_p.h.

Referenced by QDBusInterfacePrivate(), and ~QDBusInterfacePrivate().


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