sashoalm
sashoalm

Reputation: 79457

Qt std::runtime_error equivalent

Does Qt have a class equivalent to std::runtime_error (like QString is equivalent to std::string)?

Specifically, std::runtime_error holds a string describing the error, so you can just do:

throw std::runtime_error("my error description");

Upvotes: 1

Views: 1507

Answers (1)

Nikos C.
Nikos C.

Reputation: 51832

No, Qt doesn't use exceptions (other than QtConcurrent::Exception for throwing and catching exceptions across threads.) Just use the standard C++ exception classes.

Upvotes: 4

Related Questions