Reputation: 79457
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
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