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
qdbuserror.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 QDBUSERROR_H
5#define QDBUSERROR_H
6
7#include <QtDBus/qtdbusglobal.h>
8#include <QtCore/qobjectdefs.h>
9#include <QtCore/qstring.h>
10
11#ifndef QT_NO_DBUS
12
13struct DBusError;
14
16
17
18class QDBusMessage;
19
20class Q_DBUS_EXPORT QDBusError
21{
23public:
59 Q_ENUM(ErrorType)
60
61 QDBusError();
62#ifndef QT_BOOTSTRAPPED
63 explicit QDBusError(const DBusError *error);
65#endif
66 QDBusError(ErrorType error, const QString &message);
69 : code(other.code), msg(std::move(other.msg)), nm(std::move(other.nm))
70 {}
71 QDBusError &operator=(QDBusError &&other) noexcept { swap(other); return *this; }
72 QDBusError &operator=(const QDBusError &other);
73#ifndef QT_BOOTSTRAPPED
74 QDBusError &operator=(const QDBusMessage &msg);
75#endif
76
77 void swap(QDBusError &other) noexcept
78 {
79 std::swap(code, other.code);
80 msg.swap(other.msg);
81 nm.swap(other.nm);
82 }
83
84 ErrorType type() const;
85 QString name() const;
86 QString message() const;
87 bool isValid() const;
88
89 static QString errorString(ErrorType error);
90
91private:
92 ErrorType code;
93 QString msg;
94 QString nm;
95 // ### This class has an implicit (therefore inline) destructor
96 // so the following field cannot be used:
97 void *unused;
98};
99Q_DECLARE_SHARED(QDBusError)
100
101#ifndef QT_NO_DEBUG_STREAM
102Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &);
103#endif
104
106
108#else
110class Q_DBUS_EXPORT QDBusError {}; // dummy class for moc
112#endif // QT_NO_DBUS
113#endif
\inmodule QtDBus
Definition qdbuserror.h:21
ErrorType
In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementa...
Definition qdbuserror.h:24
@ InvalidInterface
Definition qdbuserror.h:51
@ UnknownProperty
Definition qdbuserror.h:46
@ PropertyReadOnly
Definition qdbuserror.h:47
@ InvalidObjectPath
Definition qdbuserror.h:50
@ InvalidSignature
Definition qdbuserror.h:43
@ UnknownInterface
Definition qdbuserror.h:44
QDBusError & operator=(QDBusError &&other) noexcept
Definition qdbuserror.h:71
QDBusError(QDBusError &&other) noexcept
Definition qdbuserror.h:68
void swap(QDBusError &other) noexcept
Swaps this QDBusError instance with other.
Definition qdbuserror.h:77
\inmodule QtDBus
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define Q_IMPLICIT
DBusConnection const char DBusError * error
Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &)
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
GLenum type
GLuint GLsizei const GLchar * message
GLuint name
@ NoError
Definition main.cpp:34
#define Q_ENUM(x)
#define Q_GADGET
QSharedPointer< T > other(t)
[5]
this swap(other)