pyQt5 change MainWindow Flags

前端 未结 2 1910
梦谈多话
梦谈多话 2021-02-07 20:58

I use python 3.4 , pyQt5 and Qt designer (Winpython distribution). I like the idea of making guis by designer and importing them in python with setupUi. I\'m able to show MainWi

2条回答
  •  花落未央
    2021-02-07 21:37

    I would propose a different solution, because it keeps the existing flags. Reason to do this, is to NOT mingle with UI-specific presets (like that a dialog has not by default a "maximize" or "minimize" button).

    self.setWindowFlags(self.windowFlags() # reuse initial flags
        & ~QtCore.Qt.WindowContextHelpButtonHint # negate the flag you want to unset
    )
    

提交回复
热议问题