PDA

View Full Version : About the mouseMoveEvent()



bingoking
26th September 2008, 04:01
In the QWidget and QGLWidget,the default policy is that, the widget only receives mouse move events when at least one mouse button is pressed while the mouse is being moved.
but in the QGraphicsScene and QGraphicsView ,the Scene or View receives mouse move events even if no buttons are pressed.i have use the setMouseTracking(false) in the QGraphicsView class,but it doesn't work. Why ?

wysota
26th September 2008, 09:21
I have use the setMouseTracking(false) in the QGraphicsView class,but it doesn't work. Why ?

You want to disable move events for graphicsview? Probably some items have hover mouse events turned on and the view enables mouse tracking to be able to send them.

bingoking
26th September 2008, 10:48
You want to disable move events for graphicsview? Probably some items have hover mouse events turned on and the view enables mouse tracking to be able to send them.


I want the scene or view to receive mouse move events only when at least one mouse button is pressed while the mouse is being moved.How to do?

wysota
26th September 2008, 11:56
Disabling hover events for all items and then disabling mouse tracking for the view (after the scene is already setup) would be my first try. Actually I'm surprised mouse tracking is turned on by default...