PyQt progress jumps to 100

后端 未结 2 1573
南方客
南方客 2020-12-04 01:14

When I run the code in the in the doWork method, by clicking the button1, the progress bar works as expected.

However, when I pass the list

2条回答
  •  余生分开走
    2020-12-04 01:46

    In my opinion, you have very fast program. Slow down a little.

    QThread.msleep(500)
    

    . ...

        for link in links:
            browser.get(link)
            progress += 100 / len(links)
            self.progressChanged.emit(progress)
    
            QThread.msleep(500)                  # !!!
    

提交回复
热议问题