Mouse position issue
Solved
General and Desktop
-
I have some code in a paint function that reads:
const QPoint globalMouseLocation(QCursor::pos()); const QPointF mouseLocation(mapFromGlobal(globalMouseLocation)); // If the mouse is not over the image , then there's nothing to do if (!displayRect.contains(mouseLocation)) return;
which works fine when the mouse is moved within the widget - it returns when it's not over displayRect.
If the mouse is moved from being over the area defined by displayRect to being over another widget/window (i.e. when displayRect extends right to the edge of the widget), then the mouse position reported is still shown is being in displayRect when in fact the mouse is over another control entirely.
What to I need to do so that I can detect its no longer over displayRect in that case.
Will making the relevant change to fix this have any unexpected side effects?
-
P Perdrix has marked this topic as solved on