// 加一个头文件
#include <QDesktopWidget>
//获取长宽就行
int currentScreenWid = QApplication::desktop()->width()
int currentScreenHei = QApplication::desktop()->height();
mainwindow->resize(currentScreenWid,currentScreenHei);
// 加一个头文件
#include <QDesktopWidget>
//获取长宽就行
int currentScreenWid = QApplication::desktop()->width()
int currentScreenHei = QApplication::desktop()->height();
mainwindow->resize(currentScreenWid,currentScreenHei);