title: QStandardItem inserting rows in a weird way
body: <p>i am creating a table and uinserting the row in it like this.only one row is inserted in the table and that too conditional and if condition isnt satisfied than an error is shown.
  the problem is that when a row is inserted on satisfying condition then,the other row when inserted on again satisfying condition doesnt re write that row but uses the next two column of that row keepinf the previous two column empty.</p>
  
  <p>Example</p>
  
  <p><strong>first result:</strong></p>
  
  <p>2 hello</p>
  
  <p><strong>second result:</strong></p>
  
  <pre><code>     3 hello
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>void searchWindow::TextReturn()
  {
          int id = (text-&gt;text()).toInt();
          map&lt;int,QString&gt;::iterator itt;
          itt = appWindow::dataa.find(id);
          if(itt != appWindow::dataa.end())           //returns 1 if we found something
          {
                  m_mode1 = new QStandardItemModel(0,2,this);
                  m_mode1-&gt;setHorizontalHeaderItem(0, new QStandardItem(QString("ID")));
                  m_mode1-&gt;setHorizontalHeaderItem(1, new QStandardItem(QString("DATA")));
  
                  m_items &lt;&lt; new QStandardItem((QString("%1").arg(id)));
                  m_items &lt;&lt; new QStandardItem((*itt).second);
                  m_mode1-&gt;appendRow(m_items);
                  m_tablee-&gt;update();
                  text-&gt;setText("");
                  m_tablee-&gt;setModel(m_mode1);
          }
          else
          {
                  m_mode1 = new QStandardItemModel(0,2,this);
                  m_mode1-&gt;setHorizontalHeaderItem(0, new QStandardItem(QString("SEQUENCE")));
                  m_mode1-&gt;setHorizontalHeaderItem(1, new QStandardItem(QString("MESSAGE")));
  
                  m_msgBox = new QMessageBox();
                  m_msgBox-&gt;setWindowTitle("Alert");
                  m_msgBox-&gt;setText("INVALID  ID  ENTERED");
                  m_msgBox-&gt;show();
                  text-&gt;setText("");
  
                  m_tablee-&gt;setModel(m_mode1);
  
          }
  }
  </code></pre>
  
  <p>thanks for any help in advance</p>