[SOLVED]QPlainTextEdit scroll to the bottom
-
Hi everyone,
I have qplaintextedit and i use insertplaintext method to add some info to qplaintextedit. But i want it to scroll automatically to the last inserted string (bottom).How can i do that?
Thanks in advance.
-
Hi,
Call "ensureCursorVisible()":http://qt-project.org/doc/qt-4.8/qplaintextedit.html#ensureCursorVisible on your text edit after insertion. Remember to call "setCenterOnScroll(true)":http://qt-project.org/doc/qt-4.8/qplaintextedit.html#centerOnScroll-prop when initializing.
-
[quote author="tilsitt" date="1358430137"]Hi,
Call "ensureCursorVisible()":http://qt-project.org/doc/qt-4.8/qplaintextedit.html#ensureCursorVisible on your text edit after insertion. Remember to call "setCenterOnScroll(true)":http://qt-project.org/doc/qt-4.8/qplaintextedit.html#centerOnScroll-prop when initializing.[/quote]
thank you. ensureCursorVisible() solved this.