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;
}
QWidget::move(int ax, int ay)
#include
QWidget w;
w.setGeometry(x,y,length,hight);
//w.move(x,y)