title: Updating a view displayed by QTableView
body: <p>I have a <code>QTableView</code> widget which is filled with the help of <code>QStandardItemModel</code>.
  In every two seconds the function containing these two classes is called using <code>QTimer</code> and next 50 entries are given.</p>
  
  <p>The function runs properly after every two seconds but the values arent refreshed in the window displayed.<br>
  Thanks in advance for any help.</p>
  
  <p>Code :</p>
  
  <pre><code>void Box::create_frame()
  {
          k=0;
          tablegroup = new QGroupBox(tr("Table"));
          QVBoxLayout *layout = new QVBoxLayout;
  
          table = new QTableView(this);
          table-&gt;setUpdatesEnabled(false);
  
          cout &lt;&lt; "recent check" &lt;&lt;endl;
          QStandardItemModel *mode = new QStandardItemModel(1,2,this);
          mode-&gt;setHorizontalHeaderItem(0, new QStandardItem(QString("ID")));
          mode-&gt;setHorizontalHeaderItem(1, new QStandardItem(QString("DATA")));
  
          map&lt;int,QString&gt;::iterator it;
  
          for(it=dataa.begin();it!=dataa.end();it++)
          {
                  for(int i=0;i&lt;=1;i++)
                  {
                          QStandardItem *item;
                          item = new QStandardItem();
                          item-&gt;setEditable(true);
                          if(i==0)
                          {
                                  item-&gt;setData(((*it).first), Qt::DisplayRole);
                                  mode-&gt;setItem(k,i,item);
                          }
                          else
                          {
                                  item-&gt;setData(((*it).second), Qt::DisplayRole);
                                  mode-&gt;setItem(k,i,item);
                          }
                  }
          k++;
          }
          //setUpdatesEnabled(false);
          table-&gt;setUpdatesEnabled(true);
          cout &lt;&lt; "create frame check" &lt;&lt; endl;
          table-&gt;setModel(mode);
          layout-&gt;addWidget(table);
          tablegroup-&gt;setLayout(layout);
  }
  
  QTimer *timer = new QTimer(this);
          connect(timer, SIGNAL(timeout()), this, SLOT(refresh()));
          timer-&gt;start(2000);
  }
  
  void dataThread::run()
  {
          boost::posix_time::seconds delay(2);
  
          int g=0;
          int h=50;
  
          while(1)
          {
                  while(g&lt;h)
                  {
                          dataa.insert(pair&lt;int,QString&gt;(g+1,"HELLO"));
                          g++;
                  }
                  boost::this_thread::sleep(delay);
                  h=h+50;
          }
  
  }
  </code></pre>