title: How to dynamically allocate cells in QTableWidget
body: <p>Im a student programmer and Im using Qt to build a GUI for one of my company's product. Essentially this GUI is going to read certain files and feed the data into a table for users to edit. I know how to construct the QTableWidget statically. In which case i used the following:</p>
  
  <pre><code> for(int x=0; x &lt; ui-&gt;tableWidgetInjectionLocations-&gt;rowCount(); x++)
      {
          for(int y=0; y &lt; ui-&gt;tableWidgetInjectionLocations-&gt;columnCount(); y++)
          {
              ui-&gt;tableWidgetInjectionLocations-&gt;setItem(x,y, qTableWidgetItemInjection);
          }
      }
  </code></pre>
  
  <p>The problem is this way creates a static or fixed number of cells I would instead like the cells to be constructed based on the user interaction. Perhaps when a user fills any cells in the last line to populate a new one or when the user scrolls down... I digress the thing is I haven't been able to find any documentation on how to approach this in <a href="http://qt-project.org/doc/qt-4.8/qtableview.html" rel="nofollow">Qt Documentation</a>. Maybe its writers block or I'm missing something obvious but any help would be awesome. Thanks for reading and thanks for any help in advance. </p>