Qt5:窗口居中显示

QDesktopWidget* desktop = QApplication::desktop(); // =qApp->desktop();也可以
move((desktop->width() - this->width())/2, (desktop->height() - this->height())/2);

转载于:https://www.cnblogs.com/wowk/p/3177041.html

你可能感兴趣的:(Qt5:窗口居中显示)