title: PySide Qt self.function not working in clicked.connect()
body: <p>I am just trying to run a class function when my button is clicked. It works when you write it like this (outside of a class):</p>
  <pre><code>from PySide2 import QtWidgets
  window =  QtWidgets.QWidget()
  
  def click_me(self):
      print('clicked me!')
  
  button1 = QtWidgets.QPushButton(&quot;Click me&quot;)
  button1.clicked.connect(click_me)
  
  layout = QtWidgets.QVBoxLayout()
  layout.addWidget(button1)
  
  window.setLayout(layout)
  window.show()
  </code></pre>
  <p>But for some reason the same thing doesn't work when inside a class:</p>
  <pre><code>from PySide2 import QtWidgets
  window =  QtWidgets.QWidget()
  
  class Tester():
      def click_me(self):
          print('clicked me!')
  
      def run(self):
          button1 = QtWidgets.QPushButton(&quot;Click me&quot;)
          button1.clicked.connect(self.click_me)
  
          layout = QtWidgets.QVBoxLayout()
          layout.addWidget(button1)
  
          window.setLayout(layout)
          window.show()
  
  Tester().run()
  </code></pre>
  <p>Could someone please help me understand why this is the case and how I can fix it. I need the class approach, so I can't just get rid of the class like in my first example.</p>
  <p>Note: I am running this in Autodesk Maya, so in my case I don't need to start up a QApplication in my code. I executed the above code by simply pasting it in the Maya terminal and running it.</p>