Qt 6.11 is out! See what's new in the release
blog
Window position with respect to screen and width and height of window
General and Desktop
5
Posts
2
Posters
2.2k
Views
1
Watching
-
Hi
Using Qt 4.8
I am trying to bind mouse cursor to the center of my application.If application is in fullscreen it works with following code
@
int middleX = QApplication::desktop()->width() >> 1;
int middleY = QApplication::desktop()->height() >> 1;QPoint newMousePos; newMousePos.setX(middleX); newMousePos.setY(middleY); QCursor::setPos(newMousePos);@
and it works.
But how do I do this when application is not fullscreen mode?
Thanks in advance