Hi, I have a class defined like this:
class GraphicsPCRectItem : public QGraphicsRectItem, public GraphicsPCItem{...

QGraphicsRectItem inherits from QAbstractGraphicsShapeItem and QGraphicsItem, while GraphicsPCItem does not inherit from any class.

In a function in a subclass I have of QGraphicsView I want to access a GraphicsPCRectItem at a certain position in the view, so what I try is ('v' is a pointer to my QGraphicsView subclass, loc is the position relative to the QGraphuicsView subclass):

QGraphicsItem *baseItem = (v->itemAt(loc)); //ok
QGraphicsRectItem *rectItem = dynamic_cast<QGraphicsRectItem*>(baseItem); //ok
GraphicsPCRectItem *item = dynamic_cast<GraphicsPCRectItem*>(rectItem); //NULL

How can I cast correctly and access the item which is actually of type GraphicsPCRectItem?