Hide close button in PySide2

   235   1   1
User Avatar
Member
4 posts
Joined: Sept. 2021
Offline
Hi guys,

I'm trying to create a window with PySide2 and now I have created a window, but I can't get rig of the close button and maximize&minimize button even after setting the PySide2.QtCore.Qt.FramelessWindowHint windowf flag like below:
        self.setWindowFlags(self.windowFlags() | QtCore.Qt.FramelessWindowHint)

So my question is: how to remove the close and maximize&minimize buttons.

Thanks
Edited by dolag233 - May 27, 2022 05:40:35
User Avatar
Member
4 posts
Joined: Sept. 2021
Offline
Ok I got it, it is because I have set parent to mainQtWindow. So simply do not set parent.
  • Quick Links