I'm trying to add a minimize button to my QDialog using this code in the constructor:
Qt::WindowFlags flags = windowFlags();
flags |= Qt::WindowMinMaxButtonsHint;
setWindowFlags(flags);
It's working on Windows but not on Linux.
Its a late answer but could be useful to others, I had the same problem and fixed like so:
Qt::WindowFlags flags = Qt::Window | Qt::WindowSystemMenuHint
| Qt::WindowMinimizeButtonHint
| Qt::WindowCloseButtonHint;
this->setWindowFlags(flags);
inside the overridden dialog constructor.
来源:https://stackoverflow.com/questions/4699808/cant-add-minimize-button-to-qdialog-under-linux