Pyqt: 'dynamically' append to qtextedit from function

后端 未结 1 1515
攒了一身酷
攒了一身酷 2021-01-06 08:12

There is a button in my pyqt gui that when clicked runs a function that does some lengthy math calculations. Inside this function there were a lot of print statements like:

相关标签:
1条回答
  • 2021-01-06 08:36

    Just make a call to QCoreApplication.processEvents after each append

    You can get your instance of QCoreApplication with the static method QCoreApplication.instance

    This will ask Qt to "refresh" your gui before finishing the tasks that are being executed, as the command processes all pending events.

    0 讨论(0)
提交回复
热议问题