PDA

View Full Version : Continously Scroll QPlainTextEdit



GimpMaster
11th September 2008, 17:24
Hey guys,

I'm just beginning with Qt, obviously thats why i'm in the newbie section.

I have a QPlainTextEdit widget in my dialog. Occasionally I added text with the appendPlainText() function. After a while the vertical scroll bar shows up. However it does not automatically scroll to show the latest appendPlainText() data.

What would you suggest to do to make sure the QPlainTextEdit is always scrolled down at the bottom after appending data?

I noticed there is a scroll(dx, dy) function. However, I was hopping I could do an absolute scroll to the end, and it would scroll all the way to the bottom? Is there a better way?

Thanks.

jpn
12th September 2008, 17:33
QPlainTextEdit is supposed to scroll automatically. However, there is a bug in QPlainTextEdit it Qt 4.4, but it has been fixed to upcoming Qt 4.5:
207241 - AutoScrolling does not seem to work when using the QPlainTextEdit::appendPlainText method (http://trolltech.com/developer/task-tracker/index_html?method=entry&id=207241)

GimpMaster
12th September 2008, 17:35
Thank you,

I would have never picked that up.