--- a/eric6/PipInterface/PipDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/PipInterface/PipDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -36,8 +36,10 @@ super(PipDialog, self).__init__(parent) 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.proc = None self.__processQueue = [] @@ -65,7 +67,7 @@ """ if ( self.proc is not None and - self.proc.state() != QProcess.NotRunning + self.proc.state() != QProcess.ProcessState.NotRunning ): self.proc.terminate() QTimer.singleShot(2000, self.proc.kill) @@ -78,11 +80,15 @@ self.__addOutput("\n\n") self.startProcess(cmd, args) else: - 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.Close).setFocus( - Qt.OtherFocusReason) + 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.buttonBox.button( + QDialogButtonBox.StandardButton.Close).setFocus( + Qt.FocusReason.OtherFocusReason) def __cancel(self): """ @@ -99,9 +105,13 @@ @param button button that was clicked @type QAbstractButton """ - if button == self.buttonBox.button(QDialogButtonBox.Close): + if button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Close + ): self.close() - elif button == self.buttonBox.button(QDialogButtonBox.Cancel): + elif button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Cancel + ): self.__cancel() def __procFinished(self, exitCode, exitStatus):