source: trunk/doc/src/snippets/code/src_qdbus_qdbusabstractinterface.cpp@ 244

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: 682 bytes
Line 
1//! [0]
2QString value = retrieveValue();
3QDBusMessage reply;
4
5QDBusReply<int> api = interface->call(QLatin1String("GetAPIVersion"));
6if (api >= 14)
7 reply = interface->call(QLatin1String("ProcessWorkUnicode"), value);
8else
9 reply = interface->call(QLatin1String("ProcessWork"), QLatin1String("UTF-8"), value.toUtf8());
10//! [0]
11
12//! [1]
13QString value = retrieveValue();
14QDBusPendingCall pcall = interface->asyncCall(QLatin1String("Process"), value);
15
16QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
17
18QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
19 this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
20//! [1]
Note: See TracBrowser for help on using the repository browser.