Struct qt_core::QUnhandledException
source · #[repr(C)]pub struct QUnhandledException { /* private fields */ }
Expand description
The UnhandledException class represents an unhandled exception in a worker thread.
C++ class: QUnhandledException
.
The UnhandledException class represents an unhandled exception in a worker thread.
If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.
Inheriting from this class is not supported.
Implementations§
source§impl QUnhandledException
impl QUnhandledException
sourcepub unsafe fn clone(&self) -> Ptr<QUnhandledException>
pub unsafe fn clone(&self) -> Ptr<QUnhandledException>
Calls C++ function: virtual QUnhandledException* QUnhandledException::clone() const
.
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QUnhandledException>>
) -> Ref<QUnhandledException>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QUnhandledException>> ) -> Ref<QUnhandledException>
The UnhandledException class represents an unhandled exception in a worker thread.
Calls C++ function: QUnhandledException& QUnhandledException::operator=(const QUnhandledException& other)
.
The UnhandledException class represents an unhandled exception in a worker thread.
If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.
Inheriting from this class is not supported.
sourcepub unsafe fn new() -> CppBox<QUnhandledException>
pub unsafe fn new() -> CppBox<QUnhandledException>
The UnhandledException class represents an unhandled exception in a worker thread.
Calls C++ function: [constructor] void QUnhandledException::QUnhandledException()
.
The UnhandledException class represents an unhandled exception in a worker thread.
If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.
Inheriting from this class is not supported.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QUnhandledException>>
) -> CppBox<QUnhandledException>
pub unsafe fn new_copy( other: impl CastInto<Ref<QUnhandledException>> ) -> CppBox<QUnhandledException>
The UnhandledException class represents an unhandled exception in a worker thread.
Calls C++ function: [constructor] void QUnhandledException::QUnhandledException(const QUnhandledException& other)
.
The UnhandledException class represents an unhandled exception in a worker thread.
If a worker thread throws an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException on the receiver thread side.
Inheriting from this class is not supported.
Methods from Deref<Target = QException>§
sourcepub unsafe fn clone(&self) -> Ptr<QException>
pub unsafe fn clone(&self) -> Ptr<QException>
In your QException subclass, reimplement clone() like this:
Calls C++ function: virtual QException* QException::clone() const
.
In your QException subclass, reimplement clone() like this:
MyException *MyException::clone() const { return new MyException(*this); }
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QException>>
) -> Ref<QException>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QException>> ) -> Ref<QException>
Qt Concurrent supports throwing and catching exceptions across thread boundaries, provided that the exception inherit from QException and implement two helper functions:
Calls C++ function: QException& QException::operator=(const QException& other)
.
Qt Concurrent supports throwing and catching exceptions across thread boundaries, provided that the exception inherit from QException and implement two helper functions:
class MyException : public QException { public: void raise() const override { throw *this; } MyException *clone() const override { return new MyException(*this); } };
QException subclasses must be thrown by value and caught by reference:
try { QtConcurrent::blockingMap(list, throwFunction); // throwFunction throws MyException } catch (MyException &e) { // handle exception }
If you throw an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException in the receiver thread.
When using QFuture, transferred exceptions will be thrown when calling the following functions:
sourcepub unsafe fn raise(&self)
pub unsafe fn raise(&self)
In your QException subclass, reimplement raise() like this:
Calls C++ function: virtual void QException::raise() const
.
In your QException subclass, reimplement raise() like this:
void MyException::raise() const { throw *this; }
Trait Implementations§
source§impl CppDeletable for QUnhandledException
impl CppDeletable for QUnhandledException
source§impl Deref for QUnhandledException
impl Deref for QUnhandledException
source§fn deref(&self) -> &QException
fn deref(&self) -> &QException
Calls C++ function: QException* static_cast<QException*>(QUnhandledException* ptr)
.
§type Target = QException
type Target = QException
source§impl DynamicCast<QUnhandledException> for QException
impl DynamicCast<QUnhandledException> for QException
source§unsafe fn dynamic_cast(ptr: Ptr<QException>) -> Ptr<QUnhandledException>
unsafe fn dynamic_cast(ptr: Ptr<QException>) -> Ptr<QUnhandledException>
Calls C++ function: QUnhandledException* dynamic_cast<QUnhandledException*>(QException* ptr)
.
source§impl StaticDowncast<QUnhandledException> for QException
impl StaticDowncast<QUnhandledException> for QException
source§unsafe fn static_downcast(ptr: Ptr<QException>) -> Ptr<QUnhandledException>
unsafe fn static_downcast(ptr: Ptr<QException>) -> Ptr<QUnhandledException>
Calls C++ function: QUnhandledException* static_cast<QUnhandledException*>(QException* ptr)
.
source§impl StaticUpcast<QException> for QUnhandledException
impl StaticUpcast<QException> for QUnhandledException
source§unsafe fn static_upcast(ptr: Ptr<QUnhandledException>) -> Ptr<QException>
unsafe fn static_upcast(ptr: Ptr<QUnhandledException>) -> Ptr<QException>
Calls C++ function: QException* static_cast<QException*>(QUnhandledException* ptr)
.