error: invalid use of incomplete type 'struct QPaint
Hello, I'm trying to implement a simple class to draw things:
Draw.h:
Code:
#ifndef DRAW_H
#define DRAW_H
#include <QWidget>
//------------------------------------
{
Q_OBJECT
public:
protected:
private:
};
#endif // DRAW_H
Draw.cpp:
Code:
#include <QPainter>
#include "draw.h"
//-------------------------------------------
{
}
//-------------------------------------------
{
QRect r
= e
->rect
();
// error: invalid use of incomplete type 'struct QPaintEvent' p.drawImage(r, image, r);
}
I don't understand this error. Incomplete type??
What am I doing wrong?
Thank you.
Re: error: invalid use of incomplete type 'struct QPaint
Add this:
Code:
#include <QPaintEvent>
Re: error: invalid use of incomplete type 'struct QPaint