How to hide MaximizeButton of QMainWindow?
This do not work:
setWindowFlags(windowFlags() &~ Qt::WindowMaximizeButtonHint);
setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint );
@raven-worx This can disable maximize button but not hide it !
i think there is no Qt-way to remove the minimize and maximize buttons.
You may want to set the
Qt::Toolflag instead the
setWindowFlags( Qt::Tool );
But this also changes the appearance and behavior of the window a bit. But tool-windows do not have minimize and maximize buttons but do also not appear in the taskbar.
@raven-worx setFixedSize is more simple than setWindowFlags, but also disable Maximize button no hide it.
If Qt::Tool is not what you want, i think disable it is the only options.
It will not be hidden unless a Tool type.