diff --git a/spyder/widgets/findinfiles.py b/spyder/widgets/findinfiles.py index 4e2b1054237..6acd861739a 100644 --- a/spyder/widgets/findinfiles.py +++ b/spyder/widgets/findinfiles.py @@ -781,7 +781,6 @@ def __init__(self, parent): self.spinner = QWaitingSpinner(self, centerOnParent=False) self.spinner.setNumberOfLines(12) self.spinner.setInnerRadius(2) - self.spinner.start() layout = QHBoxLayout() layout.addWidget(self.spinner) layout.addWidget(self.status_text) @@ -799,6 +798,16 @@ def set_label_path(self, path, folder=False): def reset(self): self.status_text.setText(_(" Searching for files...")) + def showEvent(self, event): + """Override show event to start waiting spinner.""" + QWidget.showEvent(self, event) + self.spinner.start() + + def hideEvent(self, event): + """Override hide event to stop waiting spinner.""" + QWidget.hideEvent(self, event) + self.spinner.stop() + class FindInFilesWidget(QWidget): """