eric6/Preferences/ConfigurationPages/EditorHighlightingStylesSelectionDialog.py

changeset 8143
2c730d5fd177
parent 8028
a4f1b68c0737
child 8218
7c09585bd960
diff -r 27f636beebad -r 2c730d5fd177 eric6/Preferences/ConfigurationPages/EditorHighlightingStylesSelectionDialog.py
--- a/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesSelectionDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesSelectionDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -40,7 +40,7 @@
         self.setupUi(self)
         
         self.__selectAllButton = self.buttonBox.addButton(
-            self.tr("Select All"), QDialogButtonBox.ActionRole)
+            self.tr("Select All"), QDialogButtonBox.ButtonRole.ActionRole)
         
         if forImport:
             self.setWindowTitle(self.tr("Import Highlighting Styles"))
@@ -56,11 +56,12 @@
         
         for name in lexerNames:
             itm = QListWidgetItem(name, self.lexersList)
-            itm.setFlags(Qt.ItemIsUserCheckable | Qt.ItemIsEnabled)
+            itm.setFlags(
+                Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
             if name in preselect:
-                itm.setCheckState(Qt.Checked)
+                itm.setCheckState(Qt.CheckState.Checked)
             else:
-                itm.setCheckState(Qt.Unchecked)
+                itm.setCheckState(Qt.CheckState.Unchecked)
         
         self.__updateOkButton()
     
@@ -71,12 +72,13 @@
         """
         for row in range(self.lexersList.count()):
             itm = self.lexersList.item(row)
-            if itm.checkState() == Qt.Checked:
+            if itm.checkState() == Qt.CheckState.Checked:
                 enable = True
                 break
         else:
             enable = False
-        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
+        self.buttonBox.button(
+            QDialogButtonBox.StandardButton.Ok).setEnabled(enable)
     
     @pyqtSlot(QListWidgetItem)
     def on_lexersList_itemChanged(self, item):
@@ -99,7 +101,7 @@
         if button is self.__selectAllButton:
             for row in range(self.lexersList.count()):
                 itm = self.lexersList.item(row)
-                itm.setCheckState(Qt.Checked)
+                itm.setCheckState(Qt.CheckState.Checked)
     
     def getLexerNames(self):
         """
@@ -111,7 +113,7 @@
         lexerNames = []
         for row in range(self.lexersList.count()):
             itm = self.lexersList.item(row)
-            if itm.checkState() == Qt.Checked:
+            if itm.checkState() == Qt.CheckState.Checked:
                 lexerNames.append(itm.text())
         
         return lexerNames

eric ide

mercurial