[Qt-qml] Global mouse coordinates

Martin Jones martin.jones at nokia.com
Wed Sep 15 01:50:12 CEST 2010


On Wed, 15 Sep 2010 09:17:47 am ext Сурик Саядян wrote:
> Can I get global mouse coordinates in MouseArea? mouseX and mouseY -
> is local coordinates. QMouseEvent conteins globalX and globalY. But in
> MouseArea they are absent. I want to move widget on the screen by
> mouse.

The best I can suggest is to use the Item::mapToItem() function to map to your 
root item.  Not global, but hopefully the position within your application is 
sufficient.

-- 
Martin




More information about the Qt-qml mailing list