[Qt-interest] QMainWindow: Prevent mouse from leaving.
R. Reucher
rene.reucher at batcom-it.net
Tue Oct 27 16:36:30 CET 2009
On Tue, 27 Oct 2009 16:30:32 +0100, Martin Guillon wrote:
> Doesn’t work for a qmainwindow.
Why not?
> It wont prevent the mouse from leaving the window.
If you really want to prevent the mouse cursor from "visually" leaving
the widget, you should enable mouseTracking and catch the QWidget's
mouseMoveEvent()... ignore()'ing a move-event outside the widget.
> Moreover it wont event send mouse move event when the mouse
> is out of the mainwindow.
AFAICT, it will, because mouse events are "grabbed" by that widget.
> And finally I want to hide the cursor. With grab the cursor can still
> leave the window and so wont be transparent.
See above.
HTH, René
--
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/
More information about the Qt-interest-old
mailing list