In Qt 5.0 - Qt Introduced the QException
class.
What is benifit of inheriting from this class? What if we throw a class that does not inherit from the QException class?
Thank you in advance!
In short, you can find the answers by reading the relatively short documentation.
Q: What is benefit of inheriting from this class?
This is the corresponding part of the documentation:
The QException class provides a base class for exceptions that can transferred across threads.
In addition to that, it integrates pretty well with the QtConcurrent
feature set, including QFuture
.
Q: What if we throw a class that does not inherit from the QException class?
This is the corresponding part of the documentation:
If you throw an exception that is not a subclass of QException, the Qt functions will throw a QUnhandledException in the receiver thread.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With