Best way to display logs in pyqt?

前端 未结 6 978
迷失自我
迷失自我 2020-12-01 01:42

I am currently working on a GUI using qt designer. I am wondering how I should go about printing strings on the GUI that acts like a logger window. I am using pyqt5.

6条回答
  •  不思量自难忘°
    2020-12-01 02:06

    Sounds like you'll want to use a QPlainTextEdit widget set to read-only.

    Consider changing the background color to gray to give the user a hint that it is not editable. It is also up to you if you want it to be scrollable or the text selectable.

    This answer can get you started subclassing QPlainTextEdit to scroll with output, save to a file, whatever.

提交回复
热议问题