title: QTableWidget Integer
body: <p>I am trying to insert and display integers in my QTableWidget.  They don't display.  It works if I convert everything to strings, but then I can't sort columns numerically--only lexically (1, 10, 100, etc.).  This is using PyQt.</p>
  
  <p>I've tried some of the suggested solutions, using QTableWidgetItem.setData(someRole,intValue), bu then nothing at all displays.  I've tried, Qt.UserRole, DisplayRole and Edit Role.  (I don't understand why these Roles are needed to display integers, but have just followed the examples).  My specific code is:</p>
  
  <pre><code>    item = QTableWidgetItem()
      item.setData = (Qt.DisplayRole,intValue)
      myTable.setItem(row, column, item)
  </code></pre>
  
  <p>The following code works, but for strings only:</p>
  
  <pre><code>    item = QTableWidgetItem(str(intValue))
      myTable.setItem(row, column, item)
  </code></pre>
  
  <p>Also, the suggestions for reading the data back, only show the object location, not the actual data.  Example, using Eric as an interpreter shell:</p>
  
  <p>item.data(Qt.DisplayRole)</p>
  
  <p>Response: PyQt4.QtCore.QVariant object at 0x1f01fa60</p>
  
  <p>or this:</p>
  
  <p>item.data(Qt.EditRole).data()</p>
  
  <p>Response: sip.voidptr object at 0x1e904a80</p>
  
  <p>Any insight is appreciated.</p>