title: How to add data to a created form? PyQt/Python/SQL
body: <p>I have created a basic form layout using splitters QListWidget and QTextBrowser. I wanted to know how i could import data from an SQL Database (or just add simple text i.e. String) to the ListWidget Boxes. Also once the user clicks on a piece of data within the ListWidget Box, how could i show (in detail) an expansion of the data in the TextBrowser box?? Also, how would i fix the splitter, so that the user cannot move, adjust the splitters??</p>
  
  <p>The code is below:</p>
  
  <pre><code>import sys, random, time, math, re
  from PyQt4 import QtGui, QtCore
  
  class MainWindow(QtGui.QMainWindow):
      def __init__(self, parent=None):
          super(MainWindow, self).__init__(parent)
          self.grouplist = QtGui.QListWidget()
          self.messageList = QtGui.QListWidget()
          self.MessageView = QtGui.QTextBrowser()
          self.messageSplitter = QtGui.QSplitter(QtCore.Qt.Vertical)
          self.messageSplitter.addWidget(self.messageList)
          self.messageSplitter.addWidget(self.MessageView)
          self.mainSplitter = QtGui.QSplitter(QtCore.Qt.Horizontal)
          self.mainSplitter.addWidget(self.grouplist)
          self.mainSplitter.addWidget(self.messageSplitter)
          self.setCentralWidget(self.mainSplitter)
  
  
          self.mainSplitter.setStretchFactor(0, 1)
          self.mainSplitter.setStretchFactor(1, 3)
          self.messageSplitter.setStretchFactor(0 ,1)
          self.messageSplitter.setStretchFactor(1, 2)
      def closeEvent(self, event):
          if self.okToContinue():
              settings = QtGui.QSettings()
              settings.setValue("MainWindow/Size", QVariant(self.size()))
              settings.setValue("MainWindow/Position", QVariant(self.pos()))
              settings.setValue("MainWindow/State", QVariant(self.saveState()))
              settings.setValue("MessageSplitter", QVariant(self.messageSplitter.saveState()))
              settings.setValue("MainSplitter", QVariant(self.manSplitter.saveState()))
          else:
              event.ignore()
  
  if __name__ == '__main__':
      app = QtGui.QApplication(sys.argv)
      window = MainWindow()
      window.show()
      sys.exit(app.exec_())
  </code></pre>