Reputation: 1216
I have seen questions asking if they can remove the maximize button, but I want to ask if it is possible to remove/disable the close button?
Upvotes: 11
Views: 22346
Reputation: 71
The CustomizeWindowHint
flag needs to be set first before the WindowCloseButtonHint
flag can be changed.
See https://stackoverflow.com/a/27496734
Upvotes: 7
Reputation: 2293
The answer is the same as the answer in the question you linked to. Only a slight change is necessary.
self.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, False)
Upvotes: 23