Results 1 to 5 of 5

Thread: QT and exceptions

  1. #1
    Join Date
    Jan 2006
    Posts
    36
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QT and exceptions

    I've come to understand that Qt does not use exceptions. Why?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT and exceptions

    Somewhere the docs state that exceptions are not supported correctly by all compilers Qt wants to support. Another problem is that exceptions are not safe to use across "compiler boundaries".
    But you may use exceptions whereever you want in your Code - they'll just pass right through the Qt code.

  3. #3
    Join Date
    Jan 2006
    Posts
    36
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT and exceptions

    What about bad_alloc?

  4. #4
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and exceptions

    I also haven't found a reliable answer but you could also see a very intresting discussion in the qt-intrest mailing list: http://lists.trolltech.com/qt-intere...ad00054-0.html

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT and exceptions

    Quote Originally Posted by krivenok
    What about bad_alloc?
    I've grepped through the code: They use new(nothrow). At least in some places they use placement new. But I have no idea whether they do it everywhere...

    My grep also showed that at critical places in the code they catch all exceptions to clean up and then throw it again.

Similar Threads

  1. Replies: 5
    Last Post: 6th September 2011, 23:19
  2. sql Exceptions
    By peace_comp in forum Qt Programming
    Replies: 2
    Last Post: 10th October 2008, 02:51
  3. Exceptions / setjmp/longjmp question
    By Aceman2000 in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2008, 17:14
  4. QSA exceptions
    By seneca in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2006, 15:27
  5. 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.