Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Make the Screen Center of Display

$
0
0
Dear All, I used following code to make the screen center of display. if there is any better solution. Kindly Share.  QDesktopWidget *desktop = QApplication::desktop();   int screenWidth, width;   int screenHeight, height;   int x, y;   QSize windowSize;   screenWidth = desktop->width();   screenHeight = desktop->height();   windowSize = size();   width = windowSize.width();   height = windowSize.height();   x = (screenWidth - width) / 2;   y = (screenHeight - height) / 2;   y -= 50; move ( x, y );   setFixedSize(windowSize.width(), windowSize.height());

Viewing all articles
Browse latest Browse all 13965

Trending Articles