[Qt-interest] How to scroll QTextEdit to the end

yogesh upreti yogesh.upreti at gmail.com
Mon Jun 21 00:21:27 CEST 2010


Hallo Group,
I have a QTextEdit Widget in my gui, which I use to display the log of work
being performed by my programme.
How do I make it sure that in this text edit (which is read only), whenever
I insert a text, it should scroll to the bottom.
I use this code in textChanged() signal of MyTextEdit. But this somehow
doesn't work.

QScrollBar *hbar = ui->MyTextEdit->horizontalScrollBar();
hbar->setValue(hbar->maximum());

Is this piece of code correct???

Thanks
Yogesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100621/6418f6b3/attachment.html 


More information about the Qt-interest-old mailing list