[Qt-interest] Autoscrolling--yet friendly--QTextEdit

Joshua Grauman jnfo-c at grauman.com
Sun Dec 12 17:14:31 CET 2010


>>> I have implemented this in the past with:
>>>
>>>      1 - Append new text.
>>>      2 - If end was visible before the addition,
>>>          auto-scroll to the new end.
>>
>> Wonderful. Which function(s) in the interface of QTextEdit did you use to
>> determine whether the end was visible?
>>
>
> Sorry, this was 20 years ago when I had
> just discovered TclTk and though it was
> the bees knees. I have not actually done
> it with Qt.
>
> If you trace into 'QTextEdit::ensureCursorVisible'
> you can probably see how they do it.
>
> Bill

You should be able to just look at the vertical scrollbar to see if it is 
scrolled to the end.

Josh



More information about the Qt-interest-old mailing list