title: Return value from button click
body: <p>I struggled with returning a value from function which is invoked when I click button in PyQt. That's how I'd like to put a value to the variable:</p>
  
  <pre><code>file_path = self.Button_open.clicked.connect(self.OpenTextFile)
  </code></pre>
  
  <p>Whole function looks like this:</p>
  
  <pre><code>def OpenTextFile(self):
      dialog = QtGui.QFileDialog()
      dialog.setWindowTitle("Choose a file to open")
      dialog.setFileMode(QtGui.QFileDialog.ExistingFile)
      dialog.setNameFilter("Text (*.txt);; All files (*.*)")
      dialog.setViewMode(QtGui.QFileDialog.Detail)
  
      filename = QtCore.QStringList()
  
      if(dialog.exec_()):
          file_name = dialog.selectedFiles()
      plain_text = open(file_name[0]).read()
      self.Editor.setPlainText(plain_text)
      return str(file_name[0])
  </code></pre>
  
  <p>Now, when I want to pass the file_path to the other function, python interpreter says</p>
  
  <blockquote>
    <p>self.Button_save.clicked.connect(self.SaveTextFile(file_path))
    TypeError: connect() slot argument should be a callable or a signal, not 'NoneType'</p>
  </blockquote>
  
  <p>Any thoughts how to make it work ?</p>