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

前端 未结 5 1178
失恋的感觉
失恋的感觉 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 13:56

    When a text edit control is resized, QWidget::resizeEvent is called. You just have to override this function in your subclass, and call verticalScrollBar -> setValue (verticalScrollBar -> minimum()) (or maximum()).

提交回复
热议问题