Hello Forum,
I am subclassing the QGraphicsItem as follows:
{
Q_OBJECT
public:
class RootGraphicsItem : public QObject , public QGraphicsItem
{
Q_OBJECT
public:
To copy to clipboard, switch view to plain text mode
And i am getting the error inside the paint function :
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:
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:
To copy to clipboard, switch view to plain text mode
Any hint on what i am missing ?
Regards
Sajjad
Bookmarks