[Qt-interest] QMainWindow: Prevent mouse from leaving.

Martin Guillon MGuillon at movea.com
Tue Oct 27 16:30:32 CET 2009


Doesn’t work for a qmainwindow. It wont prevent the mouse from leaving the window.Moreover it wont event send mouse move event when the mouse is out of the mainwindow.
And finally I want to hide the cursor. With grab the cursor can still leave the window and so wont be transparent.


-----Message d'origine-----
De : qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] De la part de R. Reucher
Envoyé : Tuesday, October 27, 2009 4:26 PM
À : qt-interest at trolltech.com
Objet : Re: [Qt-interest] QMainWindow: Prevent mouse from leaving.

On Tue, 27 Oct 2009 16:20:16 +0100, Martin Guillon wrote:
> I have an application which aim is to change the volume as you move your
> mouse.if you go up it will raise the volume ... My problem is that I
> don't want the mouse to leave the application window until we quit the
> application(let s say with ESC). I don't see anything to do that in QT.
> I have the windows clip cursor function but it's not cross plateform.
> 
> Does anyone has any on how to do that in QT? or even with a code that
> would be cross-plateform?
I guess this should help:

http://qt.nokia.com/doc/4.5/qwidget.html#grabMouse
http://qt.nokia.com/doc/4.5/qwidget.html#releaseMouse

HTH, René
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list