![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qexception.h>
Public Member Functions | |
QUnhandledException (std::exception_ptr exception=nullptr) noexcept | |
~QUnhandledException () noexcept override | |
QUnhandledException (QUnhandledException &&other) noexcept | |
Move-constructs a QUnhandledException, making it point to the same object as other was pointing to. | |
QUnhandledException (const QUnhandledException &other) noexcept | |
Constructs a QUnhandledException object as a copy of other. | |
void | swap (QUnhandledException &other) noexcept |
QUnhandledException & | operator= (const QUnhandledException &other) noexcept |
Assigns other to this QUnhandledException object and returns a reference to this QUnhandledException object. | |
void | raise () const override |
QUnhandledException * | clone () const override |
std::exception_ptr | exception () const |
![]() | |
~QException () noexcept | |
virtual void | raise () const |
In your QException subclass, reimplement raise() like this: | |
virtual QException * | clone () const |
In your QException subclass, reimplement clone() like this: | |
\inmodule QtCore
The QUnhandledException class represents an unhandled exception in a Qt Concurrent worker thread.
If a worker thread throws an exception that is not a subclass of QException, the \l{Qt Concurrent} functions will throw a QUnhandledException on the receiver thread side. The information about the actual exception that has been thrown will be saved in the QUnhandledException class and can be obtained using the exception() method. For example, you can process the exception held by QUnhandledException in the following way:
Inheriting from this class is not supported.
Definition at line 30 of file qexception.h.
|
noexcept |
Constructs a new QUnhandledException object. Saves the pointer to the actual exception object if exception is passed.
Definition at line 116 of file qexception.cpp.
|
overridenoexcept |
Definition at line 168 of file qexception.cpp.
|
noexcept |
Move-constructs a QUnhandledException, making it point to the same object as other was pointing to.
Definition at line 125 of file qexception.cpp.
|
noexcept |
Constructs a QUnhandledException object as a copy of other.
Definition at line 133 of file qexception.cpp.
|
overridevirtual |
Reimplemented from QException.
Definition at line 178 of file qexception.cpp.
std::exception_ptr QUnhandledException::exception | ( | ) | const |
Returns a \l{https://en.cppreference.com/w/cpp/error/exception_ptr}{pointer} to the actual exception that has been saved in this QUnhandledException. Returns a null
pointer, if it does not point to an exception object.
Definition at line 163 of file qexception.cpp.
References QUnhandledExceptionPrivate::exceptionPtr.
|
noexcept |
Assigns other to this QUnhandledException object and returns a reference to this QUnhandledException object.
Definition at line 142 of file qexception.cpp.
|
overridevirtual |
|
inlinenoexcept |
Swaps this QUnhandledException with other. This function is very fast and never fails.
Definition at line 39 of file qexception.h.