title: Pyside2 trigger messagebox from button click closes whole application
body: <p>i want to trigger a <code>messagebox</code> from a button click without closing the entire application, I managed to do this in my previous project, but this time, the behavior is really unexpected. as soon as I clicked <code>ok</code> or the cross sign on the <code>messagebox</code>, the app also closing too without any error. here's the minimal example</p>
  <pre><code>class MainWindow(QtWidgets.QMainWindow):
      def __init__(self):
          super(MainWindow, self).__init__()
          self.set_and_load_ui()
  
      def set_and_load_ui(self):
          self.ui = QUiLoader().load('main.ui', self)
  
      def trigger_messagebox(self):
          self.messagebox()
  
      def messagebox(self,x=&quot;&quot;):
          msg = QMessageBox(self)
          msg.setIcon(QMessageBox.Information)
          msg.setText(&quot;{}&quot;.format(x))
          msg.setInformativeText(&quot;test&quot;)
          msg.setWindowTitle(&quot;test&quot;)
          msg.exec_()
  
  app = QtWidgets.QApplication(sys.argv)
  mainWindow = MainWindow()
  mainWindow.ui.show()
  # mainWindow.trigger_messagebox() #this is fine
  mainWindow.ui.mainmenuButton.clicked.connect(lambda: mainWindow.trigger_messagebox()) #this is not fine
  exit_code = (app.exec_())
  </code></pre>
  <p>just to check, if the messagebox itself is causing the problem, I tried to call it directly on my code, but turns out it just fine, but not when I tried to trigger it by a button click</p>