When inheriting from QGraphicsItem, you're supposed to provide an implementation to type() by setting an enum { Type = UserType + N } (N is different for each inheritance) so that a call to qgraphicsitem_cast works.
We haven't done that correctly, which means we are using dynamic_cast instead. I think it might be cleaner, more Qt-ish and (maybe?) for efficient to do so.
When inheriting from
QGraphicsItem
, you're supposed to provide an implementation totype()
by setting anenum { Type = UserType + N }
(N
is different for each inheritance) so that a call toqgraphicsitem_cast
works.We haven't done that correctly, which means we are using
dynamic_cast
instead. I think it might be cleaner, more Qt-ish and (maybe?) for efficient to do so.