简体   繁体   English

如何最小化Qt中的setFixedSize方法已将其大小设置为固定的无框架窗口?

[英]How to minimize a frameless window which has been set size to fixed by method setFixedSize in Qt?

How to minimize a frameless window which has been set size to fixed by method setFixedSize in Qt? 如何最小化Qt中的setFixedSize方法已将其大小设置为固定的无框架窗口?

Hi, I'm using C++ code to make a Qt application. 嗨,我正在使用C ++代码制作Qt应用程序。 I set the window to frameless by 我将窗口设置为无框

this->setWindowFlags(Qt::FramelessWindowHint);

So I can't click the minimize button support by Operating System and I made a customed one. 因此,我无法单击“操作系统”中的“最小化”按钮支持,因此无法进行自定义。 But, when I want to use 但是,当我想使用

this.showMinimized();

I found that it can't work with window which has been set fixed size by 我发现它不能与已被设置为固定大小的窗口一起使用

this.setFixedSize(width, height);

So my question is, is there some other ways to make the window minimized which can be used by a window that set fixed size? 所以我的问题是,是否有其他方法可以使设置为固定大小的窗口使用的窗口最小化?

This is almost definitely not what you are looking for, but most if not all modern operating systems contain a minimize-all keyboard shortcut or show desktop button. 这几乎绝对不是您想要的,但是,即使不是全部,大多数现代操作系统都包含一个最小化所有键盘快捷键或显示桌面按钮。 You may have the button on your task bar, if you have one. 如果有的话,您可能在任务栏上有该按钮。 If not, try windows-key+d or control-alt-d. 如果没有,请尝试使用Windows键+ d或control-alt -d。 If you want to learn about how to minimize a qt window from within your code(what I think you probably want), I recommend you check out the surprisingly clear documentation at doc.qt.io . 如果您想了解如何从代码中最小化qt窗口(我想您可能想要的),建议您查阅doc.qt.io上令人惊讶的清晰文档。

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

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