PDA

View Full Version : Unhandled Exception from DLL QT 4.6.0



qlarity_three
4th February 2010, 23:34
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.


//Here is a snippet of the header code:
#include <Windows.h>
#include <QT/qpainter.h>
#include <QT/qimage.h>

class QTWrapper
public:
QTWrapper();
virtual ~QTWrapper();
private:
QImage qImage;
QPainter qPaint;
};


//sample of source file
QTWrapper::QTWrapper( )
{
qImage = QImage(0, 0);
qPaint.begin(&qImage);
}

QTWrapper::~QTWrapper()
{
}

So on the destructions of QTWrapper, I get an unhandled exception from the QPainter class in QtGui4d.dll. Any ideas?

Coises
5th February 2010, 02:10
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.

qlarity_three
5th February 2010, 19:11
.end() throws the same exception.