Last change
on this file since 244 was 2, checked in by Dmitry A. Kuminov, 16 years ago |
Initially imported qt-all-opensource-src-4.5.1 from Trolltech.
|
File size:
668 bytes
|
Line | |
---|
1 | {
|
---|
2 | //! [0]
|
---|
3 | QDBusPendingCall async = iface->asyncCall("RemoteMethod", value1, value2);
|
---|
4 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
|
---|
5 |
|
---|
6 | QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
|
---|
7 | this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
|
---|
8 | //! [0]
|
---|
9 |
|
---|
10 | }
|
---|
11 |
|
---|
12 | //! [1]
|
---|
13 | void MyClass::callFinishedSlot(QDBusPendingCallWatcher *call)
|
---|
14 | {
|
---|
15 | QDBusPendingReply<QString, QByteArray> reply = *call;
|
---|
16 | if (reply.isError()) {
|
---|
17 | showError();
|
---|
18 | } else {
|
---|
19 | QString text = reply.argumentAt<0>();
|
---|
20 | QByteArray data = reply.argumentAt<1>();
|
---|
21 | showReply(text, data);
|
---|
22 | }
|
---|
23 | }
|
---|
24 | //! [1]
|
---|
Note:
See
TracBrowser
for help on using the repository browser.