PDA

View Full Version : qtextbrowser stop scrolling on append



tpf80
16th September 2007, 19:58
Hi, I notice that there are a few of posts related to making a qtextbrowser scroll, but I can't seem to exactly find what I am looking for.

What I have is a qtextbrowser that I append data to. This works fine, but when I append data, the qtextbrowser auto-scrolls to the bottom.

Is it possible to have the qtextbrowser not scroll when data is appended to it, and only when the user scrolls it themselves?

marcel
16th September 2007, 20:10
The text browser automatically adjusts its scrollbars, so there is little or nothing you can do about this.

You can try(might cause flicker):


//add content to text browser
textBrowser->horizontalScrollBar()->setValue(0);
textBrowser->verticalScrollBar()->setValue(0);

Basically this just readjusts the scrollbars' positions to 0.

tpf80
16th September 2007, 20:28
textBrowser->verticalScrollBar()->setValue(0);
Works well for what I need. Since a user wouldn't be scrolling the widget while data is being appended, I can append all the data that is needed, then force it to the top using the hint you provided me. It actually happens so fast that It appears to be scrolled to the top from the get-go with no flicker.

Thanks again :)