title: PYQT pass a function from one class to another window
body: <p>Hey guys I want to use the directory that my function gets in one classes function in another window.  I want to pass the directory chosen to the popup window so it can show all the files.  Any help would be apprciated </p>
  
  <pre><code>class createedditConvertorpage(QtGui.QMainWindow):
          def __init__(self,parent = None):
              QtGui.QWidget.__init__(self, parent)
  
  
      def selectFilecsvtoxml(self):
  
              directory = QtGui.QFileDialog.getExistingDirectory(self, "Pick a folder")
              print directory
              self.listDirPath.setText(directory)
  
              for file_name in os.listdir(directory):
                  if not file_name.startswith("."):
  
                      print (file_name) +  "   this is selectFilcestoxml"
              self.directory = directory
              return directory
  
  class readoutWindow(QtGui.QDialog):
      def openTxt(self):
          directoryFile = createedditConvertorpage()
          directoryFile.selectFilecsvtoxml()
          print "this s open text"
          print str(directoryFile)
          for file_name in directoryFile:
              if file_name.endswith(".txt"):
  
  
                  print (file_name) +  "   this is txt file"
  
    File "/home/ed/Development/Python/Workmain/windows.py", line 1425, in home
      self.openTxt()
    File "/home/ed/Development/Python/Workmain/windows.py", line 1442, in openTxt
      for file_name in directoryFile:
  TypeError: 'createedditConvertorpage' object is not iterable
  </code></pre>