PDA

View Full Version : QPlainTextEdit scroll to bottom



vrltwe
15th August 2014, 17:41
In order to scroll QPlainTextEdit contents to bottom, I've tried
ui->plainTextEdit->verticalScrollBar()->setValue(ui->plainTextEdit->verticalScrollBar()->maximum()); which works partially. The QPlainTextEdit is in one tab of a QTabWidget, if the focus is in the QPlainTextEdit tab then it works. But, if data is added while the focus is in another tab, when I go back to the QPlainTextEdit tab it only shows one line of text at the top.

ChrisW67
15th August 2014, 21:44
What does scrolling to the bottom of existing content have to do with adding more content, how much of that content is visible, or focus? We cannot see your code or output so we can only fguess.

Please provide a small example of code that demonstrates the problem.

You should also consider QPlainTextEdit::centerCursor() and QPlainTextEdit::ensureCursorVisible()