Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_qdbus_qdbusreply.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QDBusPendingCall>
4#include <QDBusInterface>
5#include <QDBusPendingReply>
6#include <QDBusReply>
7
9{
11
12public:
14 : QObject(parent) {
15 interface = new QDBusInterface("org.example.Interface", "/Example/Methods");
16 }
17
21 void showError(const QDBusError&);
22public slots:
23
24private:
26};
28{
29//! [0]
30QDBusReply<QString> reply = interface->call("RemoteMethod");
31if (reply.isValid())
32 // use the returned value
33 useValue(reply.value());
34else
35 // call failed. Show an error condition.
36 showError(reply.error());
37//! [0]
38
39
40//! [1]
41reply = interface->call("RemoteMethod");
42//! [1]
43}
void showError(const QDBusError &)