I work on a big project using QTreeView with a custom model. I did a longer break because of other interests but more importantly because of a big (design) problem which I couldn't solve.
I often have to change the content of the tree view. I know layoutChanged has to be used there but it doesn't work in this case. I have to do a bigger process which uses a second thread and a progress window. While this will be done events of the model will be progressed on so many functions (index, parent...).
So the question is how this can be prevented. Please help I absolutely have no idea.

To explain it in more details. If through fetchMore happens a "special" case a longer progress starts in a second thread. In all other cases there is no problem. It took me some time to figure out that index and parent will be called from old or new events. I started with tries to ignore those calls but it could happen in too many functions and is a very bad method. All signals from Qt couldn't be used (modelReset) or used without effect.

There is no use of the tree view in the progress it's only to see how long it takes and for canceling so it could be disabled or something similar.