I use a QSqlTableModel with several views. When processing large amounts of data - using insertRecord(), insertRow() or setData() - the automatic updating of the views costs much processor time. I am looking for a proper way to disable the views before processing data and (re)enabling them afterwards.

I tried subclassing QSqlTableModel and the Views by adding a signal/slot enableView(bool). At enableView(false) the views remove the model by calling setModel(0) and they restore to the original model at enableView(true). This works fine and gains lots of time. The drawback is, that it limits the reusabiltiy of the views, and makes it impossible or difficult to use proxymodels.

Any suggestions?