First of all, I\'d like to mention that I found that related post How to get the mouse position on the screen in Qt? but it \"just didn\'t work\" for me. I made some tests,
This may seem like a trivial solution, but on my KDE it works (I ran into the same problems originally). If you want to determine the local mouse coordinates with respect to a widget (this will be in device pixels and relative to the top left corner of the widget I believe) you can use
QWidget::mapFromGlobal(QCursor::pos());
i.e. call this->mapFromGlobal.