简体   繁体   English

我用 QT4.7 调用了 showMaximized(),出现了一个奇怪的问题

[英]I called showMaximized() with QT4.7,A strange question came up

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。我找到了问题的原因是因为我调用了QWidget::setWindowFlags(Qt::FramelessWindowHint);这导致showMaximized()显示错误的结果。所以我重新实现了这两个函数。

 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); }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM