http://qt-project.org/doc/qt-4.8/qgraphicsitem.html
To write your own graphics item, you first create a subclass of QGraphicsItem, and then start by implementing its two pure virtual public functions: boundingRect(), which returns an estimate of the area painted by the item, and paint(), which implements the actual painting.
You must override these functions in rifle
as they are pure virtual functions in the base class.