sajis997
16th November 2011, 12:03
Hello Forum,
I am subclassing the QGraphicsItem as follows:
class RootGraphicsItem : public QObject , public QGraphicsItem
{
Q_OBJECT
public:
And i am getting the error inside the paint function :
RootGraphicsItem.cpp: In member function ‘virtual void RootGraphicsItem::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*)’:
RootGraphicsItem.cpp:473: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:488: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:489: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:491: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:492: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp: At global scope:
Any hint on what i am missing ?
Regards
Sajjad
I am subclassing the QGraphicsItem as follows:
class RootGraphicsItem : public QObject , public QGraphicsItem
{
Q_OBJECT
public:
And i am getting the error inside the paint function :
RootGraphicsItem.cpp: In member function ‘virtual void RootGraphicsItem::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*)’:
RootGraphicsItem.cpp:473: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:488: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:489: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:491: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp:492: error: invalid use of incomplete type ‘struct QPainter’
/usr/include/qt4/QtGui/qwindowdefs.h:64: error: forward declaration of ‘struct QPainter’
RootGraphicsItem.cpp: At global scope:
Any hint on what i am missing ?
Regards
Sajjad