[Qt-interest] qwidget grabmouse weird behaviour

Giancarlo Amati ilferraresebono at hotmail.it
Mon Mar 30 14:12:15 CEST 2009


mmmm sounds good to me, but mapTo or any others map...refferted to the widget or to the main window where my widget is the central one....sorry I'm very new to QT.

Kind Regards.
GC.

Date: Mon, 30 Mar 2009 17:36:25 +0530
Subject: Re: [Qt-interest] qwidget grabmouse weird behaviour
From: ankit17.ag at gmail.com
To: ilferraresebono at hotmail.it
CC: qt-interest at trolltech.com

Can't the point obtained here be mapped to the widgetby using mapTo(QWidget *, const QPoint &)

2009/3/30 Giancarlo Amati <ilferraresebono at hotmail.it>






Hello everybody,

QVTKWidget is a class derived from QWidget...and I'm using the fuction grabMouse to detect the position of the mouse.
Now, I would love the position of the cursor respect the position and the dimension of the widget and not respect my screen resolution, infact:


_ui->qvtkWidget->grabMouse(mc);
 QPoint p = mc.pos();
 printf("Point: %d %d", p.x(), p.y());
 _ui->qvtkWidget->releaseMouse();

where qvtkWidget is the widget. Now mc is filled up with my the position of the mouse respect to the dimensions and resolution of the screen and not respect to the widget itself.

WHY?

Kind Regards.
Giancarlo

Chiavette USB. addio!  Attiva SkyDrive!

_______________________________________________

Qt-interest mailing list

Qt-interest at trolltech.com

http://lists.trolltech.com/mailman/listinfo/qt-interest




-- 
Regards,
Ankit Agarwal
SW Engineer
Vegayan Systems
email : ankit_agarwal at vegayan.com
Blog : http://ankit17.wordpress.com

_________________________________________________________________
Non solo posta: scopri i nuovi servizi Windows Live.
http://clk.atdmt.com/GBL/go/136430530/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090330/e9e3f930/attachment.html 


More information about the Qt-interest-old mailing list