![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qexception.h>
Public Member Functions | |
~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 QException class provides a base class for exceptions that can be transferred across threads.
Qt Concurrent supports throwing and catching exceptions across thread boundaries, provided that the exception inherits from QException and implements two helper functions:
QException subclasses must be thrown by value and caught by reference:
If you throw an exception that is not a subclass of QException, the \l{Qt Concurrent} functions will throw a QUnhandledException in the receiver thread.
When using QFuture, transferred exceptions will be thrown when calling the following functions: \list
Definition at line 21 of file qexception.h.
|
noexcept |
Definition at line 85 of file qexception.cpp.
|
virtual |
In your QException subclass, reimplement clone() like this:
Reimplemented in MyException, and QUnhandledException.
Definition at line 95 of file qexception.cpp.
|
virtual |
In your QException subclass, reimplement raise() like this:
Reimplemented in MyException, and QUnhandledException.
Definition at line 89 of file qexception.cpp.
References e.
Referenced by QtFuture::makeExceptionalFuture(), and QFutureInterfaceBase::reportException().