Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't add minimize button to QDialog under linux

Tags:

c++

qt

qdialog

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.

like image 622
sashoalm Avatar asked Nov 27 '25 20:11

sashoalm


1 Answers

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.

like image 142
andrea Avatar answered Nov 30 '25 11:11

andrea



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!