title: Quick updates in table with Qt UI
body: <p>I created a snipped of code that implements a QAbstractTable model and retrieves the values from random generator. What I was aiming was to get approx 60 updates per second(that was the initial expectations, but I can go down to less, as long as CPU utilization is not very high)</p>
  <p>This is the code of the tablemodel:</p>
  <pre><code>#include &quot;tablemodel.h&quot;
  #include &lt;QRandomGenerator64&gt;
  
  TableModel::TableModel(QWidget* parent)
      : QAbstractTableModel(parent)
  {
      for(int i = 0 ; i &lt; ROWS; ++i){
          for(int j = 0; j &lt; COLS; ++j){
              m_values[i][j] = QRandomGenerator::global()-&gt;generate();
          }
      }
  }
  
  int TableModel::rowCount(const QModelIndex &amp;) const
  {
      return ROWS;
  }
  
  int TableModel::columnCount(const QModelIndex &amp;) const
  {
      return COLS;
  }
  
  QVariant TableModel::data(const QModelIndex &amp;index, int role) const
  {
      if (role == Qt::DisplayRole){
  //       return QString(&quot;%1&quot;).arg(m_values[index.row()][index.column()]);
          return QString(&quot;%1&quot;).arg(QRandomGenerator::global()-&gt;generate());
      }
      return QVariant();
  }
  
  void TableModel::update()
  {
      emit dataChanged(index(0,0), index(ROWS-1,COLS-1));
  }
  </code></pre>
  <p>and this is the code of the table view owner:</p>
  <pre><code>
  TableHolder::TableHolder(QWidget *parent)
      : QMainWindow(parent)
      , ui(new Ui::OptionChain),
        m_table_model(parent),
        m_timer(this)
  {
      ui-&gt;setupUi(this);
      ui-&gt;tableView-&gt;horizontalHeader()-&gt;setDefaultSectionSize(7);
      ui-&gt;tableView-&gt;verticalHeader()-&gt;setDefaultSectionSize(7);
      ui-&gt;tableView-&gt;setModel(&amp;m_table_model);
      connect(&amp;m_timer, &amp;QTimer::timeout, this, &amp;TableHolder::refresh);
      m_timer.start(16);
  }
  
  TableHolder::~TableHolder()
  {
      m_timer.stop();
      delete ui;
  }
  
  void TableHolder::refresh()
  {
      m_table_model.update();
  }
  </code></pre>
  <p>But when I run the example in Windows 10, the table slows down to less than one update per second, when the table size is 44x36. I know it's 1.5k cells, but I am surprised how bad is the performance.</p>
  <p>I do need sorting, column interactions etc, therefore drawing from scratch does not seem to be a good idea...
  Also, tried QTreeView, with the same model, but similar performance...</p>
  <p>Any ideas how to make this faster?</p>