title: Change background color for a cell in a QTableModel
body: <p>I want to color a cell in a <code>QTableView</code>.</p>
  
  <p>So  I'm trying to change the <code>itemData</code> of the corresponding item in the associated <code>QTableModel</code>.</p>
  
  <p>To do so, I use the <code>setItemData</code> method of the <code>QAbstractTableModel</code> class.</p>
  
  <p>In the documentation :</p>
  
  <p><code>QAbstractItemModel::setItemData(const QModelIndex &amp; index, const QMap &lt; int, QVariant &gt; &amp; roles)</code></p>
  
  <p>This is my piece of code :</p>
  
  <pre><code>color = QtGui.QColor(Qt.red)
  self.model.setItemData(self.model.index(3,3),color,Qt.BackgroundRole)
  </code></pre>
  
  <p>I thought this would color the third cell of the model (horizontally and vertically) in red.</p>
  
  <p>But the application answers : </p>
  
  <pre><code>TypeError: QAbstractItemModel.setItemData(QModelIndex, dict-of-int-QVariant): argument 2 has unexpected type 'QColor'
  </code></pre>
  
  <p>If I try to transform the <code>Qcolor</code> type in a <code>Qvariant</code> :</p>
  
  <pre><code>color = Qt.QVariant(QtGui.QColor(Qt.red))
  self.model.setItemData(self.model.index(3,3),color,Qt.BackgroundRole)
  </code></pre>
  
  <p>Answer : </p>
  
  <pre><code>TypeError: PyQt4.QtCore.QVariant represents a mapped type and cannot be instantiated
  </code></pre>
  
  <p>Which I really can't understand.</p>
  
  <p>So there is my question : which type of data must I put in the second parameter of a <code>setItemData</code> method?</p>
  
  <p>Thanks for advance</p>