title: Qt ui: speed up big table
body: <p>I have a QTableWidget table with more than 2000 rows. When i add QToolButton "Remove" in each row, it become a little bit slow). Why table become slow, buttons ui or signal mapper? How can i speed up my table, maybe replace buttons with something else or connect signals in other way?</p>
  
  <hr>
  
  <p>My code for buttons:</p>
  
  <pre><code>    // mapper for remove buttons
      QSignalMapper* signalMapper = new QSignalMapper(this);
      connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(RemoveString(int)), Qt::UniqueConnection);
  </code></pre>
  
  <p><em>than for each row:</em></p>
  
  <pre><code>    //remove button
      QToolButton* remove_button = new QToolButton(this);
      remove_button-&gt;setText("Remove");
      signalMapper-&gt;setMapping(remove_button, index);
      connect(remove_button, SIGNAL(clicked()), signalMapper, SLOT(map()), Qt::UniqueConnection);
      ui-&gt;locale_table-&gt;setCellWidget(index, 3, remove_button);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/S6rOb.png" alt="enter image description here"> </p>