title: Pyside2 QAction triggers once automatically but not when user clicks the menu
body: <p>I've created a simple GUI using qt designer and imported it into my python project. The main window comes up, and the menus/buttons are responsive, but I cannot manage to connect my QActions to custom functions (I did it for buttons though, and it works). The weird thing is that my custom function (<code>on_action_clicked</code>) is called once when I run the application, but not when I click on the menu items or icons of the toolbar (I tried connecting both). Below are the test codes. Am I missing something?</p>
  
  <p><strong>imbrowser3d.ui</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ui version="4.0"&gt;
   &lt;class&gt;MainWindow&lt;/class&gt;
   &lt;widget class="QMainWindow" name="MainWindow"&gt;
    &lt;property name="geometry"&gt;
     &lt;rect&gt;
      &lt;x&gt;0&lt;/x&gt;
      &lt;y&gt;0&lt;/y&gt;
      &lt;width&gt;851&lt;/width&gt;
      &lt;height&gt;649&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name="windowTitle"&gt;
     &lt;string&gt;MainWindow&lt;/string&gt;
    &lt;/property&gt;
    &lt;widget class="QWidget" name="centralwidget"&gt;
     &lt;widget class="QGraphicsView" name="gv_image"&gt;
      &lt;property name="geometry"&gt;
       &lt;rect&gt;
        &lt;x&gt;0&lt;/x&gt;
        &lt;y&gt;0&lt;/y&gt;
        &lt;width&gt;731&lt;/width&gt;
        &lt;height&gt;501&lt;/height&gt;
       &lt;/rect&gt;
      &lt;/property&gt;
     &lt;/widget&gt;
     &lt;widget class="QScrollBar" name="sb_index"&gt;
      &lt;property name="geometry"&gt;
       &lt;rect&gt;
        &lt;x&gt;0&lt;/x&gt;
        &lt;y&gt;510&lt;/y&gt;
        &lt;width&gt;701&lt;/width&gt;
        &lt;height&gt;20&lt;/height&gt;
       &lt;/rect&gt;
      &lt;/property&gt;
      &lt;property name="orientation"&gt;
       &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
      &lt;/property&gt;
     &lt;/widget&gt;
     &lt;widget class="QScrollBar" name="sb_zeta"&gt;
      &lt;property name="geometry"&gt;
       &lt;rect&gt;
        &lt;x&gt;0&lt;/x&gt;
        &lt;y&gt;530&lt;/y&gt;
        &lt;width&gt;701&lt;/width&gt;
        &lt;height&gt;20&lt;/height&gt;
       &lt;/rect&gt;
      &lt;/property&gt;
      &lt;property name="orientation"&gt;
       &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
      &lt;/property&gt;
     &lt;/widget&gt;
     &lt;widget class="QLabel" name="label_index"&gt;
      &lt;property name="geometry"&gt;
       &lt;rect&gt;
        &lt;x&gt;700&lt;/x&gt;
        &lt;y&gt;510&lt;/y&gt;
        &lt;width&gt;55&lt;/width&gt;
        &lt;height&gt;16&lt;/height&gt;
       &lt;/rect&gt;
      &lt;/property&gt;
      &lt;property name="text"&gt;
       &lt;string&gt;index&lt;/string&gt;
      &lt;/property&gt;
     &lt;/widget&gt;
     &lt;widget class="QLabel" name="label_zeta"&gt;
      &lt;property name="geometry"&gt;
       &lt;rect&gt;
        &lt;x&gt;700&lt;/x&gt;
        &lt;y&gt;530&lt;/y&gt;
        &lt;width&gt;55&lt;/width&gt;
        &lt;height&gt;16&lt;/height&gt;
       &lt;/rect&gt;
      &lt;/property&gt;
      &lt;property name="text"&gt;
       &lt;string&gt;zeta&lt;/string&gt;
      &lt;/property&gt;
     &lt;/widget&gt;
     &lt;widget class="QPushButton" name="pushButton"&gt;
      &lt;property name="geometry"&gt;
       &lt;rect&gt;
        &lt;x&gt;740&lt;/x&gt;
        &lt;y&gt;500&lt;/y&gt;
        &lt;width&gt;93&lt;/width&gt;
        &lt;height&gt;28&lt;/height&gt;
       &lt;/rect&gt;
      &lt;/property&gt;
      &lt;property name="text"&gt;
       &lt;string&gt;PushButton&lt;/string&gt;
      &lt;/property&gt;
     &lt;/widget&gt;
    &lt;/widget&gt;
    &lt;widget class="QMenuBar" name="menubar"&gt;
     &lt;property name="geometry"&gt;
      &lt;rect&gt;
       &lt;x&gt;0&lt;/x&gt;
       &lt;y&gt;0&lt;/y&gt;
       &lt;width&gt;851&lt;/width&gt;
       &lt;height&gt;26&lt;/height&gt;
      &lt;/rect&gt;
     &lt;/property&gt;
     &lt;widget class="QMenu" name="menuFile"&gt;
      &lt;property name="title"&gt;
       &lt;string&gt;File&lt;/string&gt;
      &lt;/property&gt;
      &lt;addaction name="menu_open"/&gt;
      &lt;addaction name="menu_save"/&gt;
      &lt;addaction name="menu_load"/&gt;
     &lt;/widget&gt;
     &lt;addaction name="menuFile"/&gt;
    &lt;/widget&gt;
    &lt;widget class="QStatusBar" name="statusbar"/&gt;
    &lt;widget class="QToolBar" name="action_toolbar"&gt;
     &lt;property name="windowTitle"&gt;
      &lt;string&gt;toolBar&lt;/string&gt;
     &lt;/property&gt;
     &lt;attribute name="toolBarArea"&gt;
      &lt;enum&gt;TopToolBarArea&lt;/enum&gt;
     &lt;/attribute&gt;
     &lt;attribute name="toolBarBreak"&gt;
      &lt;bool&gt;false&lt;/bool&gt;
     &lt;/attribute&gt;
     &lt;addaction name="action_save_state"/&gt;
    &lt;/widget&gt;
    &lt;action name="menu_open"&gt;
     &lt;property name="text"&gt;
      &lt;string&gt;Open&lt;/string&gt;
     &lt;/property&gt;
    &lt;/action&gt;
    &lt;action name="menu_save"&gt;
     &lt;property name="icon"&gt;
      &lt;iconset&gt;
       &lt;normaloff&gt;ui_icons/save_icon.png&lt;/normaloff&gt;ui_icons/save_icon.png&lt;/iconset&gt;
     &lt;/property&gt;
     &lt;property name="text"&gt;
      &lt;string&gt;Save state&lt;/string&gt;
     &lt;/property&gt;
    &lt;/action&gt;
    &lt;action name="menu_load"&gt;
     &lt;property name="text"&gt;
      &lt;string&gt;Load state&lt;/string&gt;
     &lt;/property&gt;
    &lt;/action&gt;
    &lt;action name="action_save_state"&gt;
     &lt;property name="icon"&gt;
      &lt;iconset&gt;
       &lt;normaloff&gt;ui_icons/save_icon.png&lt;/normaloff&gt;ui_icons/save_icon.png&lt;/iconset&gt;
     &lt;/property&gt;
     &lt;property name="text"&gt;
      &lt;string&gt;Save state&lt;/string&gt;
     &lt;/property&gt;
     &lt;property name="toolTip"&gt;
      &lt;string&gt;Save state&lt;/string&gt;
     &lt;/property&gt;
    &lt;/action&gt;
   &lt;/widget&gt;
   &lt;resources/&gt;
   &lt;connections/&gt;
  &lt;/ui&gt;
  </code></pre>
  
  <p><strong>main.py</strong></p>
  
  <pre><code>import sys
  from PySide2.QtUiTools import QUiLoader
  from PySide2.QtWidgets import QApplication, QAction, QPushButton,  QFileDialog
  from PySide2.QtCore import QFile, QObject
  
  
  class UiMainWindow(QObject):
  
      def __init__(self, ui_file, parent=None):
          super(UiMainWindow, self).__init__(parent)
          ui_file = QFile(ui_file)
          ui_file.open(QFile.ReadOnly)
  
          loader = QUiLoader()
          self.window = loader.load(ui_file)
          ui_file.close()
  
          self.btn = self.window.findChild(QPushButton, 'pushButton')
          self.btn.clicked.connect(self.on_btn_clicked)
          self.action_save = self.window.findChild(QAction, 'action_save_state')
          self.action_save.triggered.connect(self.on_action_clicked('action clicked'))
          self.window.show()
  
      def on_action_clicked(self, txt):
          print(txt)
  
      def on_btn_clicked():
          print('button clicked')
  
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      form = UiMainWindow('imbrowser3d.ui')
      sys.exit(app.exec_())
  </code></pre>