void MainWindow::onBtnMenuMaxClicked(bool)
{
QRect deskTopRect = qApp->desktop()->availableGeometry();
if (max==true) {
int allw = deskTopRect.width();
int allh = deskTopRect.height();
int unitw=allw/4;
int unith=allh/4;
this->resize(unitw*2,unith*2);
this->move(unitw,unith);
ui->pushButton_max->setToolTip(tr("最大化"));
}
if (max==false)
{
qDebug()<<"dataRecvSend rectApp= "<
ui->pushButton_max->setToolTip(tr("还原"));
}
max = !max;
}
去设置里面
瞧瞧啊
很容易弄的