I have multiple QGraphicsItem
s in scene spread across different parts of scene. In application there are different modes in one of mode user can scroll the scene (palm drag mode).
To achieve scrolling over scene I set dragMode
of QGraphicsView
to ScrollHandDrag
.
But the problem is when user try to scroll over scene by dragging (MousePress
and MouseMove
) on any of QGraphicsItem
instead of scrolling scene it moves QGraphicsItem
.
How can I stop movement of QGraphicsItem
and scroll the scene, but I still want to select QGraphicsItem
s?
Any Solution or any pointers will help.
NOTE : There are very large number of QGraphicsItem
s and are of various type.
So It is not possible to install event filter on QGraphicsItem
s.
Instead of modifying the item flags I set the whole view not interactive while in ScrollHandDrag Mode. The problem is, that you need to have an additional interaction type (i.e. Control Key, Other Mouse Button etc) to enable it.
setDragMode(ScrollHandDrag);
setInteractive(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With