title: Inserting data from sqlite database to QTableWidget using PyQt in Python
body: <p>I want to insert my data which is stored in a sqlite table, to a <code>QTableWidget</code>. I use two <code>for</code> loop to find the data and index. after each iteration I print the data in console and it is OK but when it displays the table widget there is only the first row and the last row filled with the data. 
  Any idea to solve this problem?</p>
  
  <p>It's obvious that <code>tblTable</code> is a <code>QTableWidget</code>!</p>
  
  <p>Here is this part of the code: </p>
  
  <pre><code>cursor.execute('''SELECT * FROM MyTable''')
  for index , form in enumerate(cursor.fetchall()):
      i = 0
      for item in form:
          print(str(item))
          self.tblTable.setItem(index, i, QtGui.QTableWidgetItem(str(item)))       
          i = i + 1
      self.tblTable.insertRow(1)
  </code></pre>