From 9c1f727f47b42edf43ed16b41fb34d2e57ee5cc1 Mon Sep 17 00:00:00 2001 From: kienle <kienle@passcal.nmt.edu> Date: Fri, 24 Mar 2023 11:08:18 -0600 Subject: [PATCH] Clear search on clear button pressed --- sohstationviewer/view/ui/main_ui.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sohstationviewer/view/ui/main_ui.py b/sohstationviewer/view/ui/main_ui.py index 5c2bda0f1..4382b26f2 100755 --- a/sohstationviewer/view/ui/main_ui.py +++ b/sohstationviewer/view/ui/main_ui.py @@ -406,10 +406,14 @@ class UIMainWindow(object): found_actions = self.search_line_edit.findChildren( QAction, clear_action_name ) - self.clear_search_action = found_actions[0] + self.clear_search_action: QAction = found_actions[0] + self.clear_search_action.triggered.connect( + self.main_window.clear_file_search + ) except IndexError: # If the name of the clear button is changed in the C++ source of - # QT, nothing will be found. So, we raise + # QT, nothing will be found. So, we raise an error to indicate this + # problem. raise ValueError('No clear button could be found. Check its ' 'objectName attribute using QObject.findChildren ' 'without a name.') -- GitLab