How to create a modal window in pyqt?
I looked into the documentation and i found 'self.setWindowModality(QtCore.Qt.WindowModal)'. I added this function to my ' init ' function, but however still was not able to create a modal dialog box. Any help will be appreciated, Thank You. QDialog has setModal() as found here . As the docs state: By default, this property is False and show() pops up the dialog as modeless. Setting this property to true is equivalent to setting QWidget.windowModality to Qt.ApplicationModal . As @sebastian noted you could use exec() . However it is better to use exec_() as the one sebastian mentioned is also a