[Qt-interest] qwidget grabmouse weird behaviour

Ankit Agarwal ankit17.ag at gmail.com
Mon Mar 30 14:06:25 CEST 2009


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!<http://clk.atdmt.com/GBL/go/136422321/direct/01/>
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090330/500b7aa6/attachment.html 


More information about the Qt-interest-old mailing list