1

I have 2 GroupBoxes and I would like to get the current mouse position local to each GroupBox and globally .

That's What I want to achieve

1 Answer 1

1

check https://doc.qt.io/qt-5/qcursor.html#pos

QPoint QCursor::pos() Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.

You can call QWidget::mapFromGlobal() to translate it to widget coordinates.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.