I have one QGraphicsScene as the main scene with several movable QGraphicsItems in it and another QGraphicsScene on top of the main scene as an overlay. The overlay scene is exactly the same size as the user's display,whereas the main scene is much bigger, so it needs to be scrolled up and down automatically.
Well, if an item in the main scene is going to be moved, I want to remove that item from the main scene and add it to the overlay scene, let the user move the item in the overlay scene and as soon as the mouse is released put it back to the main scene. This provides me a smooth auto scrolling of the main scene, when the item approaches to the edges of the display.
The problem is the following; as soon as an item is being removed from its scene, it receives an QMouseUngrab event, so it is not possible to continue moving the item without clicking it again in the overlay scene. I have tried to prevent the ungrab event or generate a fake QMousePress in the overlayscene, however none of them solved the issue.
Do you have an idea how I can start moving an item in one scene and continue moving it in another scene without any break?
In other words:
- QMousePress happens in the main scene
- Several QMouseMove's and finally a QMouseRelease should happen in the overlay scene
- Right after QMouseRelease the item will be put back to the main scene