Results 1 to 3 of 3

Thread: Unhandled Exception from DLL QT 4.6.0

  1. #1
    Join Date
    Feb 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Unhandled Exception from DLL QT 4.6.0

    Been using QT for a couple weeks now, but I'm only needing to use two classes at this time QPainter, and QImage. However on the destruction of a QPainter instance, I'm getting an exception from the DLL.

    Qt Code:
    1. //Here is a snippet of the header code:
    2. #include <Windows.h>
    3. #include <QT/qpainter.h>
    4. #include <QT/qimage.h>
    5.  
    6. class QTWrapper
    7. public:
    8. QTWrapper();
    9. virtual ~QTWrapper();
    10. private:
    11. QImage qImage;
    12. QPainter qPaint;
    13. };
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. //sample of source file
    2. QTWrapper::QTWrapper( )
    3. {
    4. qImage = QImage(0, 0);
    5. qPaint.begin(&qImage);
    6. }
    7.  
    8. QTWrapper::~QTWrapper()
    9. {
    10. }
    To copy to clipboard, switch view to plain text mode 

    So on the destructions of QTWrapper, I get an unhandled exception from the QPainter class in QtGui4d.dll. Any ideas?
    Attached Images Attached Images
    Last edited by qlarity_three; 5th February 2010 at 00:40.

  2. #2
    Join Date
    Nov 2009
    Posts
    129
    Thanks
    4
    Thanked 29 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Unhandled Exception from DLL QT 4.6.0

    I have a guess: perhaps qImage gets destroyed before qPaint, while it is still “attached” to qPaint. Try calling qPaint.end() in the destructor for QTWrapper.

  3. #3
    Join Date
    Feb 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Unhandled Exception from DLL QT 4.6.0

    .end() throws the same exception.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 10:49
  2. Unhandled Exception
    By dougbroadwell in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2009, 23:32
  3. Unhandled Exception in QTableView->setModel(QSqlTableModel)
    By dougbroadwell in forum Qt Programming
    Replies: 0
    Last Post: 19th March 2009, 20:35
  4. Replies: 3
    Last Post: 27th January 2009, 10:31
  5. Unhandled Exception Err
    By Masih in forum Newbie
    Replies: 9
    Last Post: 25th July 2007, 21:28

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.