I am writing a program using an example
I am interested in two classes there: DiagramItem and Arrow. I leave Arrow practically unchanged, and I replace DiagramItem with my own CircuitElement, which is inherited from QGraphicsItem.
Next, in one of the Arrow methods, the mapFromItem (...) function is called, the first argument of which is const QGraphicsItem *. I pass there an object of my CircuitElement type and the conversion does not occur. Although in the example with DiagramItem works.