From: Ralphred Date: Tue, 8 Oct 2024 09:25:25 +0000 (+0100) Subject: fixed not emptying the model on "search failure" and "no results" X-Git-Url: https://git.liquid.me.uk/?a=commitdiff_plain;h=6e133a0d084e76ebbbd7ec9bd9ccc0e9c96a1f89;p=qtgentools.git fixed not emptying the model on "search failure" and "no results" --- diff --git a/pyqt6eix b/pyqt6eix index f1af285..2e369d6 100755 --- a/pyqt6eix +++ b/pyqt6eix @@ -299,9 +299,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): data,excd=process.communicate() if excd is not None or len(data)<17: self.s_pbar.setFormat('Search Failed!!') + self.s_clearResults() + self.s_lcd_results.display(0) return if data.split('\n')[0]=='No matches found': self.s_pbar.setFormat('No matches found!!') + self.s_clearResults() + self.s_lcd_results.display(0) return self.s_pbar.setValue(0) self.s_pbar.setFormat('Processing Data: Pass 1/2...') @@ -369,6 +373,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): model.setHorizontalHeaderLabels(['Category|Overlay','Name|Version Type','Description|Version','Homepage|Use Flags' ]) return model + def s_clearResults(self): + model=self.s_createResultsModel() + self.s_tv_results.setModel(model) + def s_addResults(self,results): model=self.s_createResultsModel() prog=1