How to program scrollbar to jump to bottom/top in case of change in QPlainTextEdit or QTextEdit area?

前端 未结 5 1176
失恋的感觉
失恋的感觉 2020-12-10 13:29

How to program scrollbar to jump to bottom/top in case of change in QPlainTextEdit or QTextEdit area? It looks like it doesn\'t have any controlling function.

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-10 14:22

    I have done in Pyqt.

    self.scrollArea.verticalScrollBar().rangeChanged.connect(self.change_scroll)

    --------

    @pyqtSlot(int, int)
    def change_scroll(self, min, max):
        print("cambio", min, max)
        self.scrollArea.verticalScrollBar().setSliderPosition(max)
    

提交回复
热议问题