eric7/Tasks/TaskViewer.py

branch
eric7
changeset 8943
23f9c7b9e18e
parent 8881
54e42bc2437a
child 9149
1810eaf18d3f
--- a/eric7/Tasks/TaskViewer.py	Mon Feb 07 22:02:35 2022 +0100
+++ b/eric7/Tasks/TaskViewer.py	Tue Feb 08 16:21:09 2022 +0100
@@ -14,6 +14,7 @@
 import os
 import fnmatch
 import threading
+import time
 
 from PyQt6.QtCore import pyqtSignal, Qt, QThread
 from PyQt6.QtWidgets import (
@@ -774,11 +775,15 @@
             progress.setWindowTitle(self.tr("Tasks"))
             
             ppath = self.project.getProjectPath()
+            
+            now = time.monotonic()
             for count, file in enumerate(files):
                 progress.setLabelText(
                     self.tr("Extracting project tasks...\n{0}").format(file))
                 progress.setValue(count)
-                QApplication.processEvents()
+                if time.monotonic() - now > 0.01:
+                    QApplication.processEvents()
+                    now = time.monotonic()
                 if progress.wasCanceled():
                     break
                 

eric ide

mercurial