PDA

View Full Version : Track Mouse Position after ApplicationDeactivate Event?



Kaylx
8th September 2011, 12:16
Hey peeps,

As the title suggests i want to be able to track the cursor position after the application receives the ApplicationDeactivate event.

I've tried using a QTimer that's started when the above event is received, I've tried setting mouseTracking to true etc, and i've tried a few others things but nothing seems to be working.
The timer is fired once then never again, and mouse tracking and other ideas stop working when the mouse moves outside the qt window. :(

Here's the scenario. We're currently porting an MFC app across to Qt. We're doing this incrementally so we're using QtWinMigrate to merge the event loops of the mfc and qt apps.

Our MFC app has an editor view which grabs the window focus anytime you hover over it. The Qt app obviously loses the focus and is deactivated. I'd like to be able to copy the functionality of the MFC app in the Qt app so it also grabs the focus back when the mouse moves over it.

Anyone got any ideas on how to do it?

Thanks,