Questions tagged [qexception]

The QException class provides a base class for exceptions that can be transferred across threads.

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:

class MyException : public QException
{
public:
    void raise() const { throw *this; }
    MyException *clone() const { return new MyException(*this); }
};

Documentation

1 questions
4
votes
1 answer

What is the purpose of QException?

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!
DesignIsLife
  • 510
  • 5
  • 11