PDA

View Full Version : Tracking the movement of a top-level widget



mcb
17th July 2009, 17:14
In this previous thread http://www.qtcentre.org/forum/f-qt-programming-2/t-grabbing-mouse-events-from-frame-of-top-level-widget-21867.html, I found that I could use moveEvent() and resizeEvent() for a top-level widget to track its new position and size. However, this event occurs after the move or resize operation. On Windows (Vista x64), I see a steady stream of move events for the widget when I drag the window frame around the desktop. However on Linux (Ubuntu 9.04), I only get one move event - after mouse button release. On OS/X, the situation is between these two extremes - I receive the move events whenever I pause the mouse movement.

What I would like to do is continuously track the position of the widget. The Windows sitiuation is acceptable, but not so Linux or the Mac. I've tried installing an event filter on QApplication and subclassing QApplication and reimplementing notify(). This doesn't help. I've tried subclassing QApplication and installing an x11EventFilter() - this doesn't help either.

Any suggestions?

Thanks in advance.

Michael

wysota
17th July 2009, 17:46
Nothing will help. With your current settings the window on Linux is moved or resized only once - after you release the mouse button. The only thing you can do is to change your desktop settings to support opaque resizes and moves. But this will only work on your system - other users might have that feature disabled for performance reasons.

mcb
26th July 2009, 06:43
Not the answer I was hoping for. Oh well. Thanks.