how can I get the handle of the window when the mouse is move,
I want to get the handle of the window and get the window's coordinateof the upper left corner and coordinate of the downer right corner .
how can I get the handle of the window when the mouse is move,
I want to get the handle of the window and get the window's coordinateof the upper left corner and coordinate of the downer right corner .
Last edited by jacek; 26th June 2008 at 22:47. Reason: fixed font
You can use QWidget::geometry() or QWidget::frameGeometry() to get the Coordinate of Widget and QWidget::mapToGlobal() to convert them in Global Coordinates.
What means?how can I get the handle of the window when the mouse is move
You can reimplement QWidget::mouseMoveEvent() to catch mouse movement and use QWidget::setMouseTracking() to set ON mouse tracking properties
A camel can go 14 days without drink,
I can't!!!
You are right.
But if you press a mouse button when pointer is on the widget and you move the pointer outside the widget you receive mouseMoveEvent.
You can grab the mouse with QWidget::grabMouse()
A camel can go 14 days without drink,
I can't!!!
But I want get the handle when the mouse clicked out side the window
Or I just move the mouse out side the window not press the mouse and move
Hi,
Can you explain your problem in details? I would like to know what are you trying to achieve so that I can help you in better way.
If that window is created by your application then you can get it easily with QApplication::allWidgets () but before that you have to grab the mouse and check whether mouse position lies within geometry of any window.
If you want to obtain the mouse press event and the window for which it is intended then you have to hook the mouse events with the help of other api's. For that you may have to depend on platform specific api's.
duduqq (13th July 2008)
J-P Nurmi
Bookmarks