title: Reading files in PyQt
body: <p>I am building a program in PyQt4 and it requires that data be pulled from multiple text files. I have a button which will select files: it's code being</p>
  
  <pre><code>qtCreatorFile = 'parser.ui'
  
  Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
  
  class MyApp(QtGui.QMainWindow, Ui_MainWindow):
      def __init__(self):
          QtGui.QMainWindow.__init__(self)
          Ui_MainWindow.__init__(self)
          self.setupUi(self)
  
          self.file_selector.clicked.connect(self.File_Selector)
  
          self.log
  
      def File_Selector(self):
          files_list = []
          filenames = str(QFileDialog.getOpenFileNames(self, "Select File", "", "*.txt"))
          self.log.insertPlainText('Loading files ' + '\n')
          self.log.insertPlainText(filenames + '\n')
  
  if __name__ == "__main__":
          app = QtGui.QApplication(sys.argv)
          window = MyApp()
          window.show()
          sys.exit(app.exec_())
  </code></pre>
  
  <p>When the button is pressed I can select the text files I need, but I'm not able to read them? When I ask it to print the filenames in the log it gives me <code>&lt;PyQt4.QtCore.QStringList object at 0x0000000002BD0BA8&gt;</code></p>
  
  <p>I also tried:</p>
  
  <pre><code>    text = open(filenames).read()
      self.log.insertPlainText(text)
  </code></pre>
  
  <p>But that gives <code>IOError: [Errno 22] invalid mode ('r') or filename: '&lt;PyQt4.QtCore.QStringList object at 0x0000000002F00BA8&gt;</code> so how do I make the <code>QStringList object</code> readable?</p>