PDA

View Full Version : Qt's Exception Handling



bruce1007
13th June 2006, 07:49
How does the Qt handle the exception? There's no any Exception class found in Qt class libray. Why don't they provide them?

ball
13th June 2006, 09:19
try
{
doSomething();
}
catch(std::exception& e)
{
qDebug()<<e.what();
}

wysota
13th June 2006, 09:30
How does the Qt handle the exception? There's no any Exception class found in Qt class libray. Why don't they provide them?

Qt simply doesn't use exceptions. The most important reason probably is that not all platforms Qt works on support exceptions, so using them would break portability. But you're free to use exceptions in your code.