As indicated in the docs: -
QCursor::pos()
Returns the position of the cursor (hot spot) of the main screen in the global coordinates of the screen.
If you have multiple screens, you can use: -
QPoint QCursor::pos(const QScreen * screen)
Please note that QScreen for Qt 5
TheDarkKnight
source share