I found the problem I think.
Seems like I have to setTextCursor(cursor) after insertion.
I missed the bit in the docs that said textCursor() returns a *copy* of the cursor object.

On 10/20/2017 05:17 PM, Frank Rueter | OHUfx wrote:
HI guys,

been really quiet in here, hopefully this channel is still used.
Quick question:
I am using a QTextEdit ti print output from an external process which is run via QProcess. However, QTextEdit does nto auto-scroll when the output fills up the widget. Based on info I found online I put this code together in the slot that feeds the stdout to my widget:

        cursor = self.outputWidget.textCursor()
        cursor.movePosition(cursor.End)
        cursor.insertText(unicode(self.process.readAll()))

        # trying to auto-scroll but tit won't work:
        sb = self.outputWidget.verticalScrollBar()
        sb.setValue(sb.maximum())
        self.outputWidget.ensureCursorVisible()


Can somebody help please?

Cheers,
frank


--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *



_______________________________________________
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside

_______________________________________________
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to