--- a/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Thu May 25 11:11:11 2023 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Thu May 25 11:12:05 2023 +0200 @@ -496,6 +496,25 @@ self.checkProgress.setVisible(False) + def __cancel(self): + """ + Private method to cancel the current check run. + """ + if self.__batch: + self.syntaxCheckService.cancelSyntaxBatchCheck() + QTimer.singleShot(1000, self.__finish) + else: + self.__finish() + + def closeEvent(self, evt): + """ + Protected method to handle a close event. + + @param evt reference to the close event + @type QCloseEvent + """ + self.__cancel() + def on_buttonBox_clicked(self, button): """ Private slot called by a button of the button box clicked. @@ -506,11 +525,7 @@ if button == self.buttonBox.button(QDialogButtonBox.StandardButton.Close): self.close() elif button == self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel): - if self.__batch: - self.syntaxCheckService.cancelSyntaxBatchCheck() - QTimer.singleShot(1000, self.__finish) - else: - self.__finish() + self.__cancel() elif button == self.showButton: self.on_showButton_clicked()