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());
↧