#include "QDesktopWidget"
QDesktopWidget* desktopWidget = QApplication::desktop();
QRect deskRect = desktopWidget->availableGeometry(); //可用区域
QRect screenRect = desktopWidget->screenGeometry(); //屏幕区域
int w = screenRect.width();
int h = screenRect.height();
if ((w > 0)&&(h > 0))
{
this->resize(QSize(w,h));
}