View Full Version : Too few MouseMoveEvents
BastiWF
24th September 2009, 14:10
Hi gals + guys!
I set mousetracking=true to the viewport of my QGraphicsview.
I am then watching over MouseMoveEvents in my MainWindow class.
Why is it that I only recieve MouseMoveEvents every 5 seconds or so even when I'm scrolling around the panel like stupid?
To make it clear: I AM recieving events, just not enough.
scascio
24th September 2009, 14:54
Why not setting mouse tracking directly to your QGraphicsView?
has your viewport something special?
BastiWF
24th September 2009, 15:08
No it does not. But by reading thru the NET it seemed like the 'way to do it'.
Anyways setting mousetracking=true directly on the QGraphicsView achieves the same effect. Rare move events.
Edit: I think I'm just not getting any events when the cursor is in the graphicsScene which is inside the graphicsview...... Only right on the crack when leaving the whole window.
I just subclassed QGraphicsScene and implemented mousemoveevent but it isnt getting called... strange!
ericV
30th September 2009, 10:26
Hello, I was experiencing the same(similar) problem.
In my case I have a Widget subclassed from QFrame. Since I want to be able to re-size the Widget, i decided to handle the mouse movements in order to set the proper cursors when hovering the edges, but at certain mouse speeds it just kept the re-size cursors even though the mouse was moving inside the widget.
That's when i noticed that you must enable mouse Tracking for all relevant Widgets, so i guess in your case you also have to enable the mouse tracking for your graphics elements.
Greets and hope this helps.
Eric
wysota
30th September 2009, 17:57
Do you get all the needed events if you hold the mouse button pressed?
srinirao
2nd November 2009, 10:38
For receiving frequent MouseMove events is it necessary that mainwindow should have its centralWidget should be of type QGraphicsView ?. In my application the central Widget is if type QWidget, I am unable to receive frequent mouseMoveEvents in mainwindow even after settings mouse tracking.
Can we not get mouseEvents without making use of QGraphicsView class ?
wysota
2nd November 2009, 17:11
Can we not get mouseEvents without making use of QGraphicsView class ?
Sure we can.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.