PDA

View Full Version : Panning



linuxdev
23rd December 2008, 15:33
Hi,

I need to implement panning, so i have reimplemented the MousePress ,MoveEvent and MouseReleaseEvent of my View,

I also need to know if mouse moves over my scene , or my custom item.
Similarly i need to know if they are pressed or released.

I have done the job in view, scene and item but only the slots of view works, what could be the issue?

Is my view eating up the events, do i need to call any function to do this?

linuxdev
24th December 2008, 07:13
Probably my query was little complex...:)

what i need is ,
I need to re-implement, MouseMove, Press , Release Events in all the view, scene and item classes , is it possible?

If i move my mouse on the screen, i need to capture in View, Scene and all items at that position is it possible?

Looking forward to responses ....

Brandybuck
29th December 2008, 22:17
QGraphicsView already has panning/scrolling functionality. Set the drag mode. Look at "Colliding Mice" demo for an example. If you want to know if the mouse is over an item, then implement hoverEnterEvent() and hoverLeaveEvent() for the item.

linuxdev
30th December 2008, 07:40
Thanks for the reply, i have done that now.