--- a/eric6/Plugins/VcsPlugins/vcsGit/GitDescribeDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsGit/GitDescribeDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -35,16 +35,18 @@ """ super(GitDescribeDialog, self).__init__(parent) self.setupUi(self) - self.setWindowFlags(Qt.Window) + self.setWindowFlags(Qt.WindowType.Window) - 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 = QProcess() self.vcs = vcs self.tagList.headerItem().setText(self.tagList.columnCount(), "") - self.tagList.header().setSortIndicator(1, Qt.AscendingOrder) + self.tagList.header().setSortIndicator(1, Qt.SortOrder.AscendingOrder) self.process.finished.connect(self.__procFinished) self.process.readyReadStandardOutput.connect(self.__readStdout) @@ -61,7 +63,7 @@ """ 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) @@ -128,7 +130,7 @@ """ 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) @@ -137,11 +139,15 @@ self.inputGroup.setEnabled(False) self.inputGroup.hide() - 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) self.__resizeColumns() self.__resort() @@ -152,9 +158,13 @@ @param button button that was clicked (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.__finish() def __procFinished(self, exitCode, exitStatus): @@ -187,7 +197,8 @@ """ Private method to resize the list columns. """ - self.tagList.header().resizeSections(QHeaderView.ResizeToContents) + self.tagList.header().resizeSections( + QHeaderView.ResizeMode.ResizeToContents) self.tagList.header().setStretchLastSection(True) def __readStdout(self): @@ -197,7 +208,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(), @@ -227,9 +238,9 @@ @param isOn flag indicating the status of the check box (boolean) """ if isOn: - self.input.setEchoMode(QLineEdit.Password) + self.input.setEchoMode(QLineEdit.EchoMode.Password) else: - self.input.setEchoMode(QLineEdit.Normal) + self.input.setEchoMode(QLineEdit.EchoMode.Normal) @pyqtSlot() def on_sendButton_clicked(self):