how to disable the window maximize icon using PyQt4?

后端 未结 4 1711
自闭症患者
自闭症患者 2021-02-06 01:18

I would like to know how to disable the window Maximise button in pyqt4. I am at present using QWidget.setFixedSize (self, QSize) to prevent user window resizing, however the ma

4条回答
  •  难免孤独
    2021-02-06 01:42

    This helped me:

    Form.setMaximumSize(QtCore.QSize(width, height))
    

    It would go here in your class:

    class Ui_Form(object):
        def setupUi(self, Form):
            Form.setObjectName("Form")
            Form.resize(328, 212)
            Form.setMaximumSize(QtCore.QSize(352, 189))
    

提交回复
热议问题