diff -r 27f636beebad -r 2c730d5fd177 eric6/Plugins/DocumentationPlugins/Ericapi/EricapiExecDialog.py --- a/eric6/Plugins/DocumentationPlugins/Ericapi/EricapiExecDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/DocumentationPlugins/Ericapi/EricapiExecDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -37,8 +37,10 @@ self.setModal(True) self.setupUi(self) - self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) - self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setEnabled(False) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel).setDefault(True) self.process = None self.cmdname = cmdname @@ -99,9 +101,13 @@ @param button button that was clicked (QAbstractButton) """ - if button == self.buttonBox.button(QDialogButtonBox.Close): + if button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Close + ): self.accept() - elif button == self.buttonBox.button(QDialogButtonBox.Cancel): + elif button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel + ): self.__finish() def __finish(self): @@ -113,15 +119,18 @@ """ if ( self.process is not None and - self.process.state() != QProcess.NotRunning + self.process.state() != QProcess.ProcessState.NotRunning ): self.process.terminate() QTimer.singleShot(2000, self.process.kill) self.process.waitForFinished(3000) - self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) - self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) - self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setEnabled(True) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel).setEnabled(False) + self.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setDefault(True) self.process = None @@ -136,7 +145,7 @@ It reads the output of the process, formats it and inserts it into the contents pane. """ - self.process.setReadChannel(QProcess.StandardOutput) + self.process.setReadChannel(QProcess.ProcessChannel.StandardOutput) while self.process.canReadLine(): s = str(self.process.readLine(), @@ -152,7 +161,7 @@ It reads the error output of the process and inserts it into the error pane. """ - self.process.setReadChannel(QProcess.StandardError) + self.process.setReadChannel(QProcess.ProcessChannel.StandardError) while self.process.canReadLine(): self.errorGroup.show()