9

I have a QStandardItemModel that provides data for a QTableView and a thread that inserts data into the model.

Is it possible to temporarily stop the model from updating the table view, and enable it later?

Daniel Hedberg
  • 5,677
  • 4
  • 36
  • 61
daisy
  • 22,498
  • 29
  • 129
  • 265

1 Answers1

7

you can use setUpdatesEnabled(bool) in your view to dis and enable the updates; maybe blockSignals(bool) could also be interesting calling it on your model; it should prevent the view from recieving the models update signals

Zaiborg
  • 2,492
  • 19
  • 28
  • The function `setUpdatesEnabled()` will effectively disable all paint events, which might be a little crude, but I realize now that maybe that's what the question is all about, avoiding flickering while updating the model with the new data. – Daniel Hedberg Jun 22 '13 at 17:52