title: PySide \ PyQt: How to return value to UI after button click?
body: <p>I am trying to return a path from a browse folder dialog box.</p>
  
  <p>I have tried passing the instance object or even attribute to the call and setting it there:</p>
  
  <p><code>self.browseBtn.clicked.connect(myExporter.browseFolder(self))</code></p>
  
  <p>or</p>
  
  <p><code>self.browseBtn.clicked.connect(myExporter.browseFolder(self.path))</code></p>
  
  <p>But this doesn't work.  It causes the browser dialog to pop open immediately upon load and then once you choose a folder it errors out with :  <em>Failed to connect signal clicked().</em></p>
  
  <p>I have tried to set the clicked call to a return, with no luck:</p>
  
  <p><code>result = self.browseBtn.clicked.connect(myExporter.browseFolder)</code></p>
  
  <p>Can someone lead me in the right direction as far as how to return a value, when you are dealing with separate classes handling the UI and logic?  Also... is it bad practice to be separating them like this?  I know I could probably easily solve this if I threw everything into just one python file, but I figured that is not proper.</p>
  
  <p>Here is my ui file (ui.py):</p>
  
  <pre><code>from PySide import QtCore, QtGui
  
  class Ui_Dialog(object):
      def __init__(self):
          self.path =""
  
      def setupUi(self, Dialog, myExporter):
          Dialog.setObjectName("Dialog")
          Dialog.resize(382, 589)
          ...
          .......
          ............. 
          .................
          self.retranslateUi(Dialog)
          self.tabWidget.setCurrentIndex(1)
          QtCore.QMetaObject.connectSlotsByName(Dialog)
  
          self.browseBtn.clicked.connect(myExporter.browseFolder)
  </code></pre>
  
  <p>Here is my exporter file (exporter.py):</p>
  
  <pre><code>class Exporter(object):
      def __init__(self):
          ...
          ......
  
      def browseFolder(self):
          ...
          .......
          do something
          ...........    
          return path
  </code></pre>
  
  <p>Here is my load/test file (loadExporter.py):</p>
  
  <pre><code>import ui as interface
  import exporter as exporter
  from PySide import QtCore, QtGui
  
  app = QtGui.QApplication.instance()
  if app is None:
      app = QtGui.QApplication(sys.argv)       
  Dialog = QtGui.QDialog()
  myExporter = exporter.Exporter()
  myUI = interface.Ui_Dialog()
  myUI.setupUi(Dialog, myExporter)
  Dialog.show()
  app.exec_()
  </code></pre>