Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Window position with respect to screen and width and height of window

$
0
0
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

Viewing all articles
Browse latest Browse all 18427

Trending Articles