diff -r 27f636beebad -r 2c730d5fd177 eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py --- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py Tue Mar 02 17:17:09 2021 +0100 @@ -34,7 +34,7 @@ """ super(HgQueuesDefineGuardsDialog, self).__init__(parent) self.setupUi(self) - self.setWindowFlags(Qt.Window) + self.setWindowFlags(Qt.WindowType.Window) self.vcs = vcs self.extension = extension @@ -137,7 +137,7 @@ else: continue itm = QListWidgetItem(icon, guard, self.guardsList) - itm.setData(Qt.UserRole, sign) + itm.setData(Qt.ItemDataRole.UserRole, sign) self.on_guardsList_itemSelectionChanged() @@ -156,7 +156,8 @@ @param guard name of the guard (string) @return reference to the guard item (QListWidgetItem) """ - items = self.guardsList.findItems(guard, Qt.MatchCaseSensitive) + items = self.guardsList.findItems( + guard, Qt.MatchFlag.MatchCaseSensitive) if items: return items[0] else: @@ -192,7 +193,7 @@ del itm itm = QListWidgetItem(icon, guard, self.guardsList) - itm.setData(Qt.UserRole, sign) + itm.setData(Qt.ItemDataRole.UserRole, sign) self.guardsList.sortItems() self.__dirtyList = True @@ -222,9 +223,13 @@ @param button button that was clicked (QAbstractButton) """ - if button == self.buttonBox.button(QDialogButtonBox.Apply): + if button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Apply + ): self.__applyGuards() - elif button == self.buttonBox.button(QDialogButtonBox.Close): + elif button == self.buttonBox.button( + QDialogButtonBox.StandardButton.Close + ): self.close() @pyqtSlot() @@ -236,7 +241,7 @@ guardsList = [] for row in range(self.guardsList.count()): itm = self.guardsList.item(row) - guard = itm.data(Qt.UserRole) + itm.text() + guard = itm.data(Qt.ItemDataRole.UserRole) + itm.text() guardsList.append(guard) args = self.vcs.initCommand("qguard")