Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
src_qdbus_qdbusinterface.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 <QDBusInterface>
4#include <QDBusReply>
5
7{
9QDBusInterface remoteApp( "com.example.Calculator", "/Calculator/Operations",
10 "org.mathematics.RPNCalculator" );
11remoteApp.call( "PushOperand", 2 );
12remoteApp.call( "PushOperand", 2 );
13remoteApp.call( "ExecuteOperation", "+" );
14QDBusReply<int> reply = remoteApp.call( "PopOperand" );
15
16if ( reply.isValid() )
17 printf( "%d", reply.value() ); // prints 4
19}
QDBusMessage call(const QString &method)
\inmodule QtDBus
\inmodule QtDBus
Definition qdbusreply.h:24
QNetworkReply * reply
void DBusInterface_main()