title: Qt C++ table fill empty items
body: <p>I have a simple <code>tableWidget</code> in my GUI that displays 2 columns. In this table I want to fill data which will be saved to a txt-file later. This works well. 
  My problem now is, that if the user doesn`t fill all cells, my program crashes. </p>
  
  <p>I can find a cell containing nothing by using </p>
  
  <pre><code>ui-&gt;tab_NFF-&gt;item(i,0)-&gt;text().isEmpty()
     qDebug() &lt;&lt; "Item " &lt;&lt;i&lt;&lt;",0 is empty" ;
  </code></pre>
  
  <p>but when I try to fill that cell with some text it doesnt work. I tried this:</p>
  
  <pre><code>if (ui-&gt;tab_NFF-&gt;item(i,0)-&gt;text().isEmpty())
      ui-&gt;tab_NFF-&gt;item(i,0)-&gt;setText("0");
  </code></pre>
  
  <p>Does this item exist after all? Is it just empty or does the computer try to fill a value in a non-existing "item" ? If so, how do I create a new item?</p>