How to keep track of thread progress in Python without freezing the PyQt GUI?

后端 未结 5 1223
余生分开走
余生分开走 2020-12-12 20:07

Questions:

  1. What is the best practice for keeping track of a tread\'s progress without locking the GUI (\"Not Responding\")?
  2. Gene
5条回答
  •  醉梦人生
    2020-12-12 20:20

    If you want to use signals to indicate progress to the main thread then you should really be using PyQt's QThread class instead of the Thread class from Python's threading module.

    A simple example which uses QThread, signals and slots can be found on the PyQt Wiki:

    https://wiki.python.org/moin/PyQt/Threading,_Signals_and_Slots

提交回复
热议问题