Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qexception.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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QTCORE_QEXCEPTION_H
6
#
define
QTCORE_QEXCEPTION_H
7
8
#
include
<
QtCore
/
qatomic
.
h
>
9
#
include
<
QtCore
/
qshareddata
.
h
>
10
11
#
ifndef
QT_NO_EXCEPTIONS
12
#
include
<
exception
>
13
#
endif
14
15
QT_REQUIRE_CONFIG
(
future
);
16
17
QT_BEGIN_NAMESPACE
18
19
20
#
if
!
defined
(
QT_NO_EXCEPTIONS
)
||
defined
(
Q_QDOC
)
21
22
class
Q_CORE_EXPORT
QException
:
public
std::exception
23
{
24
public
:
25
QException() =
default
;
26
~QException()
noexcept
;
27
QException(
const
QException &) =
default
;
28
QException &operator=(
const
QException &) =
default
;
29
virtual
void
raise()
const
;
30
virtual
QException *clone()
const
;
31
};
32
33
class
QUnhandledExceptionPrivate
;
34
class
Q_CORE_EXPORT QUnhandledException final :
public
QException
35
{
36
public
:
37
QUnhandledException(std::exception_ptr exception =
nullptr
)
noexcept
;
38
~QUnhandledException()
noexcept
override;
39
40
QUnhandledException(QUnhandledException &&other)
noexcept
;
41
QUnhandledException(
const
QUnhandledException &other)
noexcept
;
42
43
void
swap(QUnhandledException &other)
noexcept
{ d.swap(other.d); }
44
45
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QUnhandledException)
46
QUnhandledException &operator=(
const
QUnhandledException &other)
noexcept
;
47
48
void
raise()
const
override;
49
QUnhandledException *clone()
const
override;
50
51
std::exception_ptr exception()
const
;
52
53
private
:
54
QSharedDataPointer<QUnhandledExceptionPrivate> d;
55
};
56
57
namespace
QtPrivate
{
58
59
class
Q_CORE_EXPORT
ExceptionStore
60
{
61
public
:
62
void
setException
(
const
QException
&
e
);
63
void
setException
(
std
::
exception_ptr
e
);
64
bool
hasException
()
const
;
65
std
::
exception_ptr
exception
()
const
;
66
void
throwPossibleException
();
67
Q_NORETURN
void
rethrowException
()
const
;
68
std
::
exception_ptr
exceptionHolder
;
69
};
70
71
}
// namespace QtPrivate
72
73
#
else
// QT_NO_EXCEPTIONS
74
75
namespace
QtPrivate {
76
77
class
Q_CORE_EXPORT ExceptionStore
78
{
79
public
:
80
ExceptionStore() { }
81
inline
void
throwPossibleException() {}
82
inline
void
rethrowException()
const
{ }
83
};
84
85
}
// namespace QtPrivate
86
87
#
endif
// QT_NO_EXCEPTIONS
88
89
QT_END_NAMESPACE
90
91
#
endif
QException
\inmodule QtCore
Definition
qexception.h:23
QUnhandledExceptionPrivate
Definition
qexception.cpp:129
QUnhandledExceptionPrivate::QUnhandledExceptionPrivate
QUnhandledExceptionPrivate(std::exception_ptr exception) noexcept
Definition
qexception.cpp:131
QUnhandledExceptionPrivate::exceptionPtr
std::exception_ptr exceptionPtr
Definition
qexception.cpp:132
QtPrivate::ExceptionStore
Definition
qexception.h:60
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtPrivate
Definition
qalloc.h:29
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
future
QFuture< void > future
[5]
Definition
src_concurrent_qtconcurrentfilter.cpp:22
qtbase
src
corelib
thread
qexception.h
Generated on
for Qt by
1.18.0