pyqt disable maximize button code example

Example 1: how to disable maximize button in pyqt5

#include <QtGui/QApplication>#include <QMainWindow> int main(int argc, char *argv[]) {     QApplication app( argc, argv );      QMainWindow win;    win.setWindowFlags( Qt::WindowTitleHint |  Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint);     win.show();     return app.exec(); };

Example 2: how to disable maximize button in pyqt5

#include <QApplication>#include <QMainWindow> int main(int argc, char *argv[]) {     QApplication app( argc, argv );      QMainWindow win(0, Qt::WindowTitleHint |                      Qt::WindowSystemMenuHint |                       Qt::WindowMinimizeButtonHint );     win.show();     return app.exec(); }