Autoscroll PyQT QTextWidget

后端 未结 3 928
慢半拍i
慢半拍i 2021-02-05 18:15

How can I autoscroll to the bottom of my QTextEdit

in my GUI init function

self.mytext = QTextEdit()
self.cursor = QTextCur         


        
3条回答
  •  攒了一身酷
    2021-02-05 18:48

    I've found the following to work:

    from PyQt4 import QtGui
    
    self.display = QtGui.QTextBrowser()
    self.display.verticalScrollBar().setValue(
        self.display.verticalScrollBar().maximum())
    

    Good luck!

提交回复
热议问题