eric7/UI/FindFileWidget.py

branch
eric7
changeset 8932
a21e80dde10e
parent 8917
18901f50f971
child 8943
23f9c7b9e18e
--- a/eric7/UI/FindFileWidget.py	Sat Jan 22 17:03:25 2022 +0100
+++ b/eric7/UI/FindFileWidget.py	Wed Jan 26 22:17:41 2022 +0100
@@ -9,6 +9,7 @@
 
 import os
 import re
+import time
 
 from PyQt6.QtCore import pyqtSignal, pyqtSlot, Qt, QPoint, QUrl
 from PyQt6.QtGui import QCursor, QDesktopServices, QImageReader
@@ -615,6 +616,7 @@
                 self.findProgress.setValue(progress)
                 continue
             
+            now = time.monotonic()
             # now perform the search and display the lines found
             for count, line in enumerate(lines, start=1):
                 if self.__cancelSearch:
@@ -641,7 +643,9 @@
                     self.__createItem(file, count, line, start, end,
                                       rline, hashStr)
                 
-                QApplication.processEvents()
+                if time.monotonic() - now > 0.01:
+                    QApplication.processEvents()
+                    now = time.monotonic()
             
             if found:
                 fileOccurrences += 1

eric ide

mercurial