--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -32,10 +32,12 @@ """ super(HgAnnotateDialog, 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.vcs = vcs self.__hgClient = vcs.getClient() @@ -98,11 +100,15 @@ Private slot called when the process finished or the user pressed the button. """ - 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() @@ -112,9 +118,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 + ): if self.__hgClient: self.__hgClient.cancel() else: @@ -124,7 +134,8 @@ """ Private method to resize the list columns. """ - self.annotateList.header().resizeSections(QHeaderView.ResizeToContents) + self.annotateList.header().resizeSections( + QHeaderView.ResizeMode.ResizeToContents) def __generateItem(self, revision, changeset, author, date, text): """ @@ -141,8 +152,8 @@ [revision, changeset, author, date, "{0:d}".format(self.lineno), text]) self.lineno += 1 - itm.setTextAlignment(0, Qt.AlignRight) - itm.setTextAlignment(4, Qt.AlignRight) + itm.setTextAlignment(0, Qt.AlignmentFlag.AlignRight) + itm.setTextAlignment(4, Qt.AlignmentFlag.AlignRight) def __processOutputLine(self, line): """