I would like to hide/unhide some parts of the text so that if I use two QString variables one for original text and one for shrinked text I have the problem to restore the screen at the right content, as example if I am at line 200 and hide the first 30 lines I would like still be at visible line 200 - 30 = 170 so that user does not see content scrolling artifact when hiding/unhiding.

To do this I hoped to find a supported way in QTextEdit because save and restore the contents positions is not easy (expecially in Qt4) and in any case I would need a map that says that line 200 of original content corresponds to line 170 of shrinked one and to do this for each line.

So a native way should be far better ;-)