--- a/eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -35,10 +35,12 @@ """ super(HgBookmarksInOutDialog, 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) if mode not in [self.INCOMING, self.OUTGOING]: raise ValueError("Bad value for mode") @@ -53,7 +55,8 @@ self.bookmarksList.headerItem().setText( self.bookmarksList.columnCount(), "") - self.bookmarksList.header().setSortIndicator(3, Qt.AscendingOrder) + self.bookmarksList.header().setSortIndicator( + 3, Qt.SortOrder.AscendingOrder) self.show() QCoreApplication.processEvents() @@ -103,11 +106,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.bookmarksList.topLevelItemCount() == 0: # no bookmarks defined @@ -121,9 +128,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: @@ -142,7 +153,7 @@ Private method to resize the list columns. """ self.bookmarksList.header().resizeSections( - QHeaderView.ResizeToContents) + QHeaderView.ResizeMode.ResizeToContents) self.bookmarksList.header().setStretchLastSection(True) def __generateItem(self, changeset, name):