blob: 49363a8136855b8fc0620be916c74a6878bd8913 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 | {
//! [0]
    QDBusPendingReply<QString> reply = interface->asyncCall("RemoteMethod");
    reply.waitForFinished();
    if (reply.isError())
        // call failed. Show an error condition.
        showError(reply.error());
    else
        // use the returned value
        useValue(reply.value());
//! [0]
//! [2]
    QDBusPendingReply<bool, QString> reply = interface->asyncCall("RemoteMethod");
    reply.waitForFinished();
    if (!reply.isError()) {
        if (reply.argumentAt<0>())
            showSuccess(reply.argumentAt<1>());
        else
            showFailure(reply.argumentAt<1>());
    }
//! [2]
}
 |