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
qdbuspendingcall.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QDBUSPENDINGCALL_H
5#define QDBUSPENDINGCALL_H
6
7#include <QtDBus/qtdbusglobal.h>
8#include <QtDBus/qdbusmessage.h>
9#include <QtCore/qobject.h>
10#include <QtCore/qshareddata.h>
11
12#ifndef QT_NO_DBUS
13
15
16
17class QDBusConnection;
18class QDBusError;
20
22class Q_DBUS_EXPORT QDBusPendingCall
23{
24public:
27 QDBusPendingCall &operator=(QDBusPendingCall &&other) noexcept { swap(other); return *this; }
28 QDBusPendingCall &operator=(const QDBusPendingCall &other);
29
30 void swap(QDBusPendingCall &other) noexcept { d.swap(other.d); }
31
32#ifndef Q_QDOC
33 // pretend that they aren't here
34 bool isFinished() const;
35 void waitForFinished();
36
37 bool isError() const;
38 bool isValid() const;
39 QDBusError error() const;
40 QDBusMessage reply() const;
41#endif
42
43 static QDBusPendingCall fromError(const QDBusError &error);
44 static QDBusPendingCall fromCompletedCall(const QDBusMessage &message);
45
46protected:
47 QExplicitlySharedDataPointer<QDBusPendingCallPrivate> d;
50 friend class QDBusConnection;
51
53
54private:
55 QDBusPendingCall(); // not defined
56};
57
58Q_DECLARE_SHARED(QDBusPendingCall)
59
60class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall
61{
63public:
64 explicit QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent = nullptr);
66
67#ifdef Q_QDOC
68 // trick qdoc into thinking this method is here
69 bool isFinished() const;
70#endif
71 void waitForFinished(); // non-virtual override
72
74 void finished(QDBusPendingCallWatcher *self = nullptr);
75};
76
78
79#endif // QT_NO_DBUS
80#endif
\inmodule QtDBus
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode=QDBus::Block, int timeout=-1) const
Sends the message over this connection and blocks, waiting for a reply, for at most timeout milliseco...
\inmodule QtDBus
Definition qdbuserror.h:21
\inmodule QtDBus
void finished(QDBusPendingCallWatcher *self=nullptr)
This signal is emitted when the pending call has finished and its reply is available.
\inmodule QtDBus
QExplicitlySharedDataPointer< QDBusPendingCallPrivate > d
void swap(QDBusPendingCall &other) noexcept
QDBusPendingCall & operator=(QDBusPendingCall &&other) noexcept
\inmodule QtCore
Definition qobject.h:103
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLuint GLsizei const GLchar * message
#define Q_OBJECT
#define Q_SIGNALS
future waitForFinished()
QSharedPointer< T > other(t)
[5]
this swap(other)
QNetworkReply * reply