How can I prevent QDialog class from closing
问题 How can I prevent QDialog class from closing after "Ok" button was pressed? I need to close the window only if the some actions were performed correctly on this dialog, in other cases I don't need to close this window. 回答1: Generally speaking, it's a bad habit to lie to the user. If a button is not disabled, then it better work when the user clicks on it. So, the obvious solution is to disable the button until the necessary preconditions are met. For buttons that finish the dialog, you should