title: Retrieving cell data from a selected cell in a tablewidget
body: <p>I am making a stock control program and i have hit a problem with getting the value of a selected cell, i know i need to use "QtGui.QTableWidget.currentRow" and "QtGui.QTableWidget.currentColumn" to get the item's position. However i cannot seem to get this to work because when the functions are called nothing has been selected and so it returns -1,-1</p>
  
  <p>Does anyone know how to get it so it runs the "QtGui.QTableWidget.currentRow" and "QtGui.QTableWidget.currentColumn" everytime the user selects a cell?</p>
  
  <p>i think the code i need to get the actual data once i have the co-ords is  QtGui.QTableWidget.item ?</p>
  
  <p>This is the code i am using to get the row and column:</p>
  
  <pre><code>row = self.table.currentRow
  column = self.table.currentColumn
  self.ID = self.table.item(row, column)
  </code></pre>
  
  <p>when the user clicks a button to add stock the program should then use the product code it will have just got to make the change to the database after getting the quantity added from the user</p>
  
  <p>I am using python 3.2 and pyqt 4</p>
  
  <p>any help would be appreciated</p>
  
  <p>Thank you </p>
  
  <p>Sam</p>