code: def connect(self, funct):
          
          def get_directory():
              rec = QFileDialog.getExistingDirectory(self,
                                                     'Path to Recording'
                                                     ' Directory')
              if rec == '':
                  return
  
              self.setText(rec)
              funct()
  
          self.clicked.connect(get_directory)
docs: Call funct when the text was changed.
  
          Parameters
          ----------
          funct : function
              function that broadcasts a change.
  
          Notes
          -----
          There is something wrong here. When you run this function, it calls
          for opening a directory three or four times. This is obviously wrong
          but I don't understand why this happens three times. Traceback did not
          help.