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?
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)
The CustomizeWindowHint
flag needs to be set first before the WindowCloseButtonHint
flag can be changed.
See https://stackoverflow.com/a/27496734
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With