--- a/eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -30,10 +30,12 @@ """ super(HgGpgSignaturesDialog, 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() @@ -78,11 +80,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) if self.signaturesList.topLevelItemCount() == 0: # no patches present @@ -96,9 +102,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.__hgClient.cancel() def __resort(self): @@ -114,7 +124,7 @@ Private method to resize the list columns. """ self.signaturesList.header().resizeSections( - QHeaderView.ResizeToContents) + QHeaderView.ResizeMode.ResizeToContents) self.signaturesList.header().setStretchLastSection(True) def __generateItem(self, revision, changeset, signature): @@ -130,7 +140,7 @@ else: revString = "{0:>7}:{1}".format(revision, changeset) topItems = self.signaturesList.findItems( - revString, Qt.MatchExactly) + revString, Qt.MatchFlag.MatchExactly) if len(topItems) == 0: # first signature for this changeset topItm = QTreeWidgetItem(self.signaturesList, [