Adding a minimize button to the Qt dialog?

I created an application based on QDialog using Qt Creator, and all is well, except for the dialogue, it does not have a button with a minimum value. How to add it? Is there a property in the designer that I can set?

+4
source share
3 answers

You cannot add the minimize button yourself, as it is controlled by the window manager. You can tell the window manager how to handle the dialog with the help of Window Manager. This is done using the windowFlags property of your widget. An example is also shown there.

 setWindowFlags(windowFlags() | Qt::WindowMinimizeButtonHint); 
+11
source

Use the QDialog Qt :: WindowFlags constructor to minimize it.

Qt::WindowMinimizeButtonHint

+6
source

You can also try using the following using setWindowState

 QWidget->setWindowState(Qt::WindowMinimized); 

This way you add a button or event to minimize dialogue.

-1
source

All Articles