I have created a QMainWindow in python with Qt library. When user clicks on the close button, I'm prompting a warning QMessageBox (Yes/No). I want to fully disable main window's functionality until user chooses yes or no -to the second window-. (I want something like "freezing" the main window.)
I have tried "self.setEnabled(False)" for the main window, but user could still click on minimize and maximize buttons.
Thank you in advance.
Nicolescu's answer is perfect and working.
When you open popup/modal(QWidgets.QWidget) window, and want to disable parent window activiy, until the child is open, just use hist example.
def init(self):
self.setWindowModality(QtCore.Qt.ApplicationModal))
disable window functionality in pyqt