eric6/Debugger/VariablesFilterDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8176
31965986ecd1
child 8218
7c09585bd960
--- a/eric6/Debugger/VariablesFilterDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/Debugger/VariablesFilterDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -38,15 +38,16 @@
         self.setupUi(self)
 
         self.defaultButton = self.buttonBox.addButton(
-            self.tr("Save Default"), QDialogButtonBox.ActionRole)
+            self.tr("Save Default"), QDialogButtonBox.ButtonRole.ActionRole)
         
         #populate the list widgets and set the default selection
         for widget in self.localsList, self.globalsList:
             for varType, varTypeStr in ConfigVarTypeDispStrings.items():
                 itm = QListWidgetItem(self.tr(varTypeStr), widget)
-                itm.setData(Qt.UserRole, varType)
-                itm.setFlags(Qt.ItemIsEnabled | Qt.ItemIsUserCheckable)
-                itm.setCheckState(Qt.Unchecked)
+                itm.setData(Qt.ItemDataRole.UserRole, varType)
+                itm.setFlags(Qt.ItemFlag.ItemIsEnabled |
+                             Qt.ItemFlag.ItemIsUserCheckable)
+                itm.setCheckState(Qt.CheckState.Unchecked)
                 widget.addItem(itm)
         
         lDefaultFilter, gDefaultFilter = Preferences.getVarFilters()
@@ -64,14 +65,14 @@
         lList = []
         for row in range(self.localsList.count()):
             itm = self.localsList.item(row)
-            if itm.checkState() == Qt.Unchecked:
-                lList.append(itm.data(Qt.UserRole))
+            if itm.checkState() == Qt.CheckState.Unchecked:
+                lList.append(itm.data(Qt.ItemDataRole.UserRole))
         
         gList = []
         for row in range(self.globalsList.count()):
             itm = self.globalsList.item(row)
-            if itm.checkState() == Qt.Unchecked:
-                gList.append(itm.data(Qt.UserRole))
+            if itm.checkState() == Qt.CheckState.Unchecked:
+                gList.append(itm.data(Qt.ItemDataRole.UserRole))
         return (lList, gList)
     
     def setSelection(self, lList, gList):
@@ -85,17 +86,17 @@
         """
         for row in range(self.localsList.count()):
             itm = self.localsList.item(row)
-            if itm.data(Qt.UserRole) in lList:
-                itm.setCheckState(Qt.Unchecked)
+            if itm.data(Qt.ItemDataRole.UserRole) in lList:
+                itm.setCheckState(Qt.CheckState.Unchecked)
             else:
-                itm.setCheckState(Qt.Checked)
+                itm.setCheckState(Qt.CheckState.Checked)
         
         for row in range(self.globalsList.count()):
             itm = self.globalsList.item(row)
-            if itm.data(Qt.UserRole) in gList:
-                itm.setCheckState(Qt.Unchecked)
+            if itm.data(Qt.ItemDataRole.UserRole) in gList:
+                itm.setCheckState(Qt.CheckState.Unchecked)
             else:
-                itm.setCheckState(Qt.Checked)
+                itm.setCheckState(Qt.CheckState.Checked)
 
     def on_buttonBox_clicked(self, button):
         """

eric ide

mercurial