Solved 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 !
-
@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. -
this helped me: Form.setMaximumSize(QtCore.QSize(width, height))
class Ui_Form(object):
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(328, 212) Form.setMaximumSize(QtCore.QSize(352, 189))
-
This post is deleted!