Logo Search packages:      
Sourcecode: kdbus version File versions  Download package

int QDBusProxy::sendWithAsyncReply ( const QString &  method,
const QValueList< QVariant > &  params 
)

Sends a method call to the peer object but does not wait for an answer.

This is roughly equivalent to calling a C++ method on a local Qt event loop driven object, where the result of the method call is delivered later through a signal.

Note:
as with Qt's asychronous classes this needs a running event loop
Parameters:
method the name of the method to invoke
params the method parameters. Use an empty list if the method does not require parameters
Returns:
a serial number to easily identify the reply once it is received or 0 if the call is not possible, i.e. the method name is empty or any of the conditions for canSend() are not met
Warning:
if a asynchronous call is followed by a synchronous call, e.g. using sendWithReply(), without returning to the event loop, is recommended to call QDBusConnection::scheduleDispatch() after the synchronous call to make sure any reply received during the blocking call is delivered
See also:
asyncReply()

send()

sendWithReply()

Method and signal names

Definition at line 167 of file qdbusproxy.cpp.

References handleAsyncReply(), and QDBusMessage::methodCall().

{
    if (!d->canSend || method.isEmpty() || !d->connection.isConnected())
        return 0;

    QDBusMessage message = QDBusMessage::methodCall(d->service, d->path,
                                                    d->interface, method);
    message += params;

    return d->connection.sendWithAsyncReply(message, this,
                   SLOT(handleAsyncReply(const QDBusMessage&)));
}


Generated by  Doxygen 1.6.0   Back to index