Morning,
I am making a little text editor in python. As many others have probably done before, I am trying to implement some folding functionality in it.

For each block I want to hide I execute:
_block.setVisible(False)
Afterwards I execute:
self.viewport().update()
I have problems when hiding everything but the first line. The loop hiding more than 80000 plus updating the viewport takes less than second which is perfectly acceptable. But afterthat, the application gets stuck for about 6 minutes showing the message "Not Responding". I cannot interact with application. After that, the result is as expected, with no error messages. And everything works great.

Any suggestion about what I could do to improve this performance?
Might it be a bug?

Kind regards,
José M.