Qt hide minimize, maximize and close buttons

后端 未结 6 1036
时光说笑
时光说笑 2020-12-10 03:58

Do you know how to hide minimize, maximize and close buttons of title bar in Qt. I especially need to hide it on QMainWindow.

6条回答
  •  囚心锁ツ
    2020-12-10 04:36

    For the close button, you can override the closeEvent() of QmainWindow

    class MainWindow(QMainWindow):    
        def closeEvent(self, event):
            event.ignore()
            return
    

提交回复
热议问题