title: Python and PyQt: Get Input from QTableWidget?
body: <p>So, I have a very simple question:
  How can I get the input from a QTableWidget and put it to some lists(first collumn to the first list, second collumn to the second list and so on...)?</p>
  
  <p>I've googled but haven't really found anything...</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Actually, I figured out this: </p>
  
  <pre><code>self.tableWidget.cellChanged.connect(self.cellchanged)
  
  
  def cellchanged(self):
      cur = self.tableWidget.currentColumn()
      cur2 = self.tableWidget.currentRow()
      y = children[cur]
      text = self.tableWidget.currentItem().text()
      y.insert(cur2, text)
  </code></pre>
  
  <p>But I get this error when I update the table (it just shows, it doesn't hurt the program):</p>
  
  <pre><code>def updatetable(self):
          self.tableWidget.setRowCount(0)
          self.tableWidget.setRowCount(100)
          r=0
          c=0
          for x in children:
              for i in x:
                  newItem = QtGui.QTableWidgetItem(i)
                  self.tableWidget.setItem(r, c, newItem)
                  r += 1
              r = 0
              c += 1
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>  if self.tableWidget.currentItem().text():
  AttributeError: 'NoneType' object has no attribute 'text'
  </code></pre>
  
  <p><strong>Update3:</strong></p>
  
  <p>Solved it:</p>
  
  <pre><code>    self.tableWidget.cellChanged.connect(self.cellchanged)
  
  
  def cellchanged(self):
      cur = self.tableWidget.currentColumn()
      cur2 = self.tableWidget.currentRow()
      y = children[cur]
      self.tableWidget.cellActivated.connect(self.cell) 
  def cell(self):
      text = self.tableWidget.currentItem().text()
      y.insert(cur2, text)
  </code></pre>