Hi,
This may be a basic C++ question, not sure.
I have a QGraphicsRectItem class, call it CIRCLE which implements painting, item events and such.
Now I want to make another QGraphicsItem called SQUARE. In this item SQUARE, it contains many CIRCLE items.
The SQUARE class only needs to create the circle items. I want the scene to add the SQUARE item, instead of creating many circle items in my scene view. ( just trying to clean up the code)
I get this error when compiling
:294: error: cannot declare variable 'SQUARE' to be of abstract type 'SQUARE'
:84: note: because the following virtual functions are pure within 'SQUARE'
/usr/local/Trolltech/QtEmbedded-4.4.1-arm/include/QtGui/qgraphicsitem.h:224: note: virtual QRectF QGraphicsItem::boundingRect() const
/usr/local/Trolltech/QtEmbedded-4.4.1-arm/include/QtGui/qgraphicsitem.h:243: note: virtual void QGraphicsItem:aint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*)
If I implement these functions in the SQUARE class then there is no error. However, I do not need to paint events for SQUARE. The painting is handled by CIRCLE class.
Please help.
Thank you
Bookmarks