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
qsystemerror_p.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 QSYSTEMERROR_P_H
5#define QSYSTEMERROR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/private/qglobal_p.h>
19#include <qstring.h>
20
22
24{
25public:
32
33 constexpr explicit QSystemError(int error, ErrorScope scope)
35 {
36 }
37 constexpr QSystemError() = default;
38
40 constexpr ErrorScope scope() const { return errorScope; }
41 constexpr int error() const { return errorCode; }
42
43 constexpr bool ok() const noexcept { return errorScope == NoError; }
44 static constexpr QSystemError stdError(int error)
46
47 static Q_CORE_EXPORT QString string(ErrorScope errorScope, int errorCode);
48 static Q_CORE_EXPORT QString stdString(int errorCode = -1);
49#ifdef Q_OS_WIN
50 static Q_CORE_EXPORT QString windowsString(int errorCode = -1);
51 using HRESULT = long;
52 static Q_CORE_EXPORT QString windowsComString(HRESULT hr);
53
54 static constexpr QSystemError nativeError(int error)
55 { return QSystemError(error, NativeError); }
56#endif
57
58 // data members
59 int errorCode = 0;
61};
62
64
65#endif // QSYSTEMERROR_P_H
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
constexpr bool ok() const noexcept
constexpr QSystemError(int error, ErrorScope scope)
static Q_CORE_EXPORT QString stdString(int errorCode=-1)
ErrorScope errorScope
constexpr QSystemError()=default
constexpr int error() const
QString toString() const
constexpr ErrorScope scope() const
static constexpr QSystemError stdError(int error)
Combined button and popup list for selecting options.
GLsizei const GLchar *const * string
[0]
Definition qopenglext.h:694
long HRESULT