[Qt-interest] Autoscrolling--yet friendly--QTextEdit
Sherif Ghali
sherif.ghali at yahoo.com
Fri Dec 10 12:49:27 CET 2010
--From: Andre Somers
--Subject: Re: [Qt-interest] Autoscrolling--yet friendly--QTextEdit
>> This doesn’t work. Why? Can you suggest a solution?
> You may want to be more specific than "doesn't work". What did you
> expect to happen?
If the user is trying to read something that scrolled out of the screen, and new
lines are appended in QTextEdit, the widget should not insist on moving the
cursor and the view to the end; it should let the user read and disable
autoscrolling.
> I think your way of doing this is incomplete. First, there are more ways
> the user may attempt to scroll the text-edit, such as by moving the
> cursor, or by manipulating the scrollbar.
That is exactly right. Indeed, the user could use the methods you suggest, and
perhaps others. But if we solve the problem for the scroll wheel, it will be
easy to do the same for the other types of events. Of course, if you are aware
of a way to catch a superset of these events just once, do suggest it!
Ideally, one would implement "If the last line is currently visible and the
scrollbar is not currently pressed, then scroll to keep any new lines visible.
Otherwise, disable auto-scrolling."
Sherif
More information about the Qt-interest-old
mailing list