Question: pyqt how to close a dialog?
Answer: You can try using the reject or accept or done function to close the dialog box. By doing this, you're setting the return value appropriately ( Rejected , Accepted or the one you specify as the argument). All in all, you should try calling YourDialog. done(n) to close the dialog and return n and YourDialog.