Results 1 to 3 of 3

Thread: Qt's Exception Handling

  1. #1
    Join Date
    May 2006
    Posts
    7
    Thanks
    2

    Unhappy Qt's Exception Handling

    How does the Qt handle the exception? There's no any Exception class found in Qt class libray. Why don't they provide them?

  2. #2
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    3
    Thanked 5 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt's Exception Handling

    try
    {
    doSomething();
    }
    catch(std::exception& e)
    {
    qDebug()<<e.what();
    }

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt's Exception Handling

    Quote Originally Posted by bruce1007
    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.

Similar Threads

  1. Exception en point flottant!!!
    By Stephano in forum General Programming
    Replies: 4
    Last Post: 22nd May 2006, 12:03
  2. string handling
    By vijay anandh in forum Qt Programming
    Replies: 4
    Last Post: 5th May 2006, 09:15
  3. Handling multiple UDP sockets
    By ecphora in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 20:01
  4. Exceptions and qApp->processEvents()
    By mcostalba in forum Qt Programming
    Replies: 3
    Last Post: 8th January 2006, 17:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.