How to disable maximize button in QT?

I want to disable maximize button in Qt

I tried

setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowMaximizeButtonHint); 
+4
source share
2 answers

In ui-> setupUi (this);

setWindowFlags(Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
+2
source

SetWindowsFlags (); didn't work for me on Ubuntu 16.04, but under ui-> setupUi (this) I added this line:

setFixedSize(width(), height());

and it works great.

+1
source

Source: https://habr.com/ru/post/1648524/


All Articles