"Best" way to tell a view not to update from the model for a known period



  • I've got a model that, deep inside, interacts with something that is very much not thread safe. It can go very, very wrong if the view is fetching data while something else is tinkering around in there. Fortunately, I can identify the set of operations that comprise this "tinkering" and thus identify times when the view really should not go asking for data. So I sometimes need to tell the view that displays the data from that model to stop updating, and then return to normal updating.

    I'm sure this is a standard thing, and I can think of a few ways to do it, but what's the conventional "best" way? Ideally, any selection won't be invalidated. I was looking at the various resetModel() and associated functions, but I don't see any explicit guarantees that the view will not ask for any data, so maybe they don't actually stop the view asking for data?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.