title: Qt/C++: Getting the data at a certain cell in a QTableView
body: <p>I'm trying to get the text at a certain cell in a <code>QTableView</code>. For example:</p>
  
  <pre><code>QString codestring = "*" + ui-&gt;tblInventory-&gt;indexAt(QPoint(0,2)).data().toString() + "*";
  </code></pre>
  
  <p>This should get the text at the cell in column 0 row 2 in my <code>QTableView</code>. The problem is, that's not what it's doing!. Regardless of the arguments I pass into the <code>QPoint()</code> in the <code>indexAt()</code>, I get the text at cell 0,0. I have no idea why this is... any help? Thanks!</p>
  
  <p>[edit]<br>
  I've also tried this:  </p>
  
  <pre><code>QString codestring = "*" + ui-&gt;tblInventory-&gt;model()-&gt;data(ui-&gt;tblInventory-&gt;indexAt(QPoint(0,2))).toString() + "*";
  </code></pre>
  
  <p>[Edit 2]
  Trying to find out what's going on, I put in this line of code:  </p>
  
  <pre><code>qDebug()&lt;&lt; ui-&gt;tblInventory-&gt;indexAt(QPoint(2,2)).row() &lt;&lt; " and " &lt;&lt;  ui-&gt;tblInventory-&gt;indexAt(QPoint(2,2)).column();
  </code></pre>
  
  <p>It should get the <code>QModelIndex</code> at cell 2,2 and output its row and its column, which of course should be 2 and 2. However, I get 0 and 0! So it seems like this might be a problem with <code>QTableView::indexAt()</code>, whether its my usage or some sort of bug. Can anyone shed some light?</p>