jjkrol
27th May 2011, 16:12
Hello,
I have a graphics scene in a graphics view.
I managed to draw rectangles (QGraphicsRectItems) and lines (QGraphicsLineItems) on the scene, but I encountered another problem:
How can I overwrite mouse events on these (and other) items?
I am quite resistant against writing my own subclasses, because I want to access many items, so it would be quite demanding and (as far as I understand) I should also subclass the QGraphicsScene to accept my items.
In my search for the solution, I came across the eventFilter. However I have read, that I cannot be applied it to QGraphicsItems.
Please, help me clarify the possible solutions for the problem.
I have a graphics scene in a graphics view.
I managed to draw rectangles (QGraphicsRectItems) and lines (QGraphicsLineItems) on the scene, but I encountered another problem:
How can I overwrite mouse events on these (and other) items?
I am quite resistant against writing my own subclasses, because I want to access many items, so it would be quite demanding and (as far as I understand) I should also subclass the QGraphicsScene to accept my items.
In my search for the solution, I came across the eventFilter. However I have read, that I cannot be applied it to QGraphicsItems.
Please, help me clarify the possible solutions for the problem.