If you override QGraphicsScene mouse event handlers, you must call the base class implementation if you want any item to receive mouse events.
If you override QGraphicsScene mouse event handlers, you must call the base class implementation if you want any item to receive mouse events.
J-P Nurmi
Qt Code:
void SubClass::virtualFunction() { BaseClass::virtualFunction(); // <--- // ... }To copy to clipboard, switch view to plain text mode
J-P Nurmi
where subclass is my subclass of QGraphicsScene
in this case called BoardModel
and BaseClass is QGraphicsScene itself?
and virtualfunction is mouseMoveEvent?
Yes, exactly. Your reimplementation is called instead of the QGraphicsScene implementation, but the QGraphicsScene implementation is the one who delivers mouse events to the items.
J-P Nurmi
Bookmarks