main.cpp里面修改
- #include "mainwindow.h"
- #include
- #include
- #include
-
-
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- MainWindow w;
- //w.show();
-
-
- //移动窗体到屏幕中央
- QRect rect = w.frameGeometry();
- QDesktopWidget desktop;
- QPoint centerPoint = desktop.availableGeometry().center();
- rect.moveCenter(centerPoint);
- w.move(rect.topLeft());
-
- w.show();
-
- return a.exec();
- }