// Get the size of screen
QDesktopWidget* desktop = QApplication::desktop();
int width = desktop->width();
int height = desktop->height();
// Create the main window
MainFrame win;
win.resize(800, 600);
win.move((width - win.width())/2, (height - win.height())/2);
win.show();