title: PySide UI as a Class: button.clicked.connect not connecting
body: <p>I'm a beginner and trying to wrap a PySide UI script into a class. So far, so good.</p>
  
  <p>However, on the button click, it isn't running the function (or it's not telling me if it is). The print statement does not process. However no error is thrown. It was running fine when I had the non-class-wrapped version.</p>
  
  <p>I know there's something I'm missing here but not sure. Please advise!</p>
  
  <p>PS - this is being done in Maya, but I'm guessing this is more of a PySide thing.</p>
  
  <pre><code>import maya.cmds as cmds
  from PySide import QtGui
  import maya.OpenMayaUI as mui
  import shiboken
  
  class UI(object):
      def __init__(self):
  
          self.constraintMaster_UI()
  
      def getMayaWindow(self):
          pointer = mui.MQtUtil.mainWindow() # This is Maya's main window
          QtGui.QMainWindow.styleSheet(shiboken.wrapInstance(long(pointer), QtGui.QWidget))
          return shiboken.wrapInstance(long(pointer), QtGui.QWidget)
  
      def clickedButton(self):
          print "You just clicked the button!"
  
      def constraintMaster_UI(self):
  
          objectName = "pyConstraintMasterWin"
  
          # Check to see if the UI exists, if so delete it
          if cmds.window("pyConstraintMasterWin", exists = True):
              cmds.deleteUI("pyConstraintMasterWin", wnd = True)
  
          # Create the window, parent it to the main Maya window (parent -&gt; window).
          # Assign the object name (window name string) to the window
          parent = self.getMayaWindow()
          window = QtGui.QMainWindow(parent)
          window.setObjectName(objectName)
          window.setWindowTitle("Constraint Master")
          window.setMinimumSize(400, 125)
          window.setMaximumSize(400, 125)
  
          # Create the main widget to contain all the stuff, parent it to the main Widget
          mainWidget = QtGui.QWidget()
          window.setCentralWidget(mainWidget)
  
          # Create the main vertical layout, add the button and its command
          verticalLayout = QtGui.QVBoxLayout(mainWidget)
  
          button = QtGui.QPushButton("Create Constraint")
          verticalLayout.addWidget(button)
          button.clicked.connect(self.clickedButton)
  
          window.show()
  
  UI()
  </code></pre>