That's what I would like to achieve:
But it turned out that way:
I found the cause of the problem because I called QWidget::setWindowFlags(Qt::FramelessWindowHint);This caused showMaximized() to show the wrong result.So I've reimplemented these two functions。
void MainWindowDef::showMax() { oldSize = this->size(); oldPoint = this->pos(); resize(QApplication::desktop()->availableGeometry().size()); move(0, 0); isMax = true; } void MainWindowDef::showOld() { resize(oldSize); move(oldPoint); }
Copyright © 2021 Jogjafile Inc.
I found the cause of the problem because I called QWidget::setWindowFlags(Qt::FramelessWindowHint);This caused showMaximized() to show the wrong result.So I've reimplemented these two functions。