//关闭按钮失效

//this->setWindowFlags(Qt::WindowMinMaxButtonsHint);

//去掉最大化、最小化按钮,保留关闭按钮

this->setWindowFlags(Qt::WindowCloseButtonHint);