How to hide MaximizeButton of QMainWindow?
-
setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint );
-
setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint );
@raven-worx This can disable maximize button but not hide it !
-
@raven-worx This can disable maximize button but not hide it !
@sonichy
i think there is no Qt-way to remove the minimize and maximize buttons.
You may want to set theQt::Tool
flag instead theQt::Window
flag: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.
-
@sonichy
i think there is no Qt-way to remove the minimize and maximize buttons.
You may want to set theQt::Tool
flag instead theQt::Window
flag: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.
-
Hi
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.