hello, i am trying to create a graphics item. I created a class called wierdo using the following code:
#ifndef WIERDO_H
#define WIERDO_H
#include <QGraphicsItem>
class Wierdo : public QGraphicsItem
{
public:
QRectF boundingRect() const { return QRectF(0, 0,100, 100);};
QPainterPath shape() const{
QPainterPath path;
path.addRect(-10, -20, 20, 40);
return path;
};
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget);
painter->drawEllipse(-10, -20, 20, 40);
painter->drawEllipse(-10, -20, 20, 40);
};
#endif // WIERDO_H
The compiler does not accept the method painter->drawEllipse(-10, -20, 20, 40); saying that there is an "unexpected `(' token". Any suggestions on why this is happening?
Thank you