PDA

View Full Version : Move graphicsView



jano_alex_es
20th November 2009, 12:04
Hi,

I have a QGraphicsScene, and when it needs the scroll bars when I click on the scene I move the graphicsView around it (QGraphicsView::ScrollHandDrag).

I suppose this is the desired behavour... but which event controls it? which event is launched when the user "moves" the view? I've tried with a lot of them (all the drag events in scene and view, for examle, are not called), in both graphicsScene and graphicsView and I don't find it :S

thanks!

wysota
20th November 2009, 12:19
It's probably mouseMoveEvent() in QGraphicsView.

jano_alex_es
20th November 2009, 12:40
Thanks! didn't think on that.

By the way, in order to learn a bit more, there is no event launched when the user clicks on the scene and moves it around?

wysota
20th November 2009, 13:12
The user can't "move the scene around". Scene is your world, there is no "around" it, you can only change its dimensions.

jano_alex_es
20th November 2009, 14:51
I just said that because that's the effect it does; the well made definition is "scroll the scroll bars".

wysota
20th November 2009, 16:25
Scrollbars move your view onto the scene. Exactly the same way ScrollHandDrag does.