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