Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_qdbus_qdbuscontext.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
4#include <QString>
5#include <QDBusConnection>
6#include <QDBusArgument>
7#include <QDBusMetaType>
8#include <QDBusMessage>
9#include <QDBusContext>
10
12class MyObject: public QObject,
13 protected QDBusContext
14{
16
17 QDBusConnection conn;
18 QDBusMessage msg;
19
20 //...
21
22protected slots:
23 void process();
24public slots:
25 void methodWithError();
27};
28
30{
32 "The method call 'methodWithError()' is not supported");
33}
34
QString methodWithDelayedReply()
void process()
\inmodule QtDBus
The QDBusContext class allows slots to determine the D-Bus context of the calls.
void setDelayedReply(bool enable) const
Sets whether this call will have a delayed reply or not.
void sendErrorReply(const QString &name, const QString &msg=QString()) const
Sends an error name as a reply to the caller.
QDBusConnection connection() const
Returns the connection from which this call was received.
const QDBusMessage & message() const
Returns the message that generated this call.
\inmodule QtDBus
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
@ QueuedConnection
#define Q_OBJECT
#define slots
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
\threadsafe This is an overloaded member function, provided for convenience. It differs from the abov...