title: Terminating PyQt App before initUI
body: <p>I am developing a PyQt application that sends mails. It reads the authentication information from a file. I'm trying to check if the authentication is ok before calling <code>initUI()</code> and to display an error message and exit the whole app if it doens't.</p>
  
  <p>This is a fragment of my code :</p>
  
  <pre><code>class Mailer(QWidget):
      def __init__(self):
          super().__init__()
  
          config = configparser.ConfigParser()
          config.read('config.ini')
  
          self.server = config["SMTP SERVER"]
          self.user = config["USER"]
          self.smtpServer = smtplib.SMTP_SSL(self.server["Host"],self.server["Port"])
  
          try:
              self.smtpServer.login(self.user["Username"],self.user["Password"])
              self.smtpServer.quit()
          except smtplib.SMTPAuthenticationError:
              QMessageBox.critical(self, "Error de autenticación", """El usuario y/o la contraseña en el archivo config.ini son incorrectos.""", QMessageBox.Ok)
              QCoreApplication.instance().quit()
  
          self.initUI()
  </code></pre>
  
  <p>The problem is that it doesn't exit the application. If I change <code>QCoreApplication.instance().quit()</code> by <code>self.close()</code> I get the same.</p>