Debugger/VariablesFilterDialog.py

changeset 5461
b0dc3f0133cd
parent 5389
9b1c800daff3
child 5479
c7d8a0cdc731
--- a/Debugger/VariablesFilterDialog.py	Tue Jan 31 18:33:52 2017 +0100
+++ b/Debugger/VariablesFilterDialog.py	Tue Jan 31 18:43:09 2017 +0100
@@ -47,6 +47,9 @@
             for varType, varTypeStr in ConfigVarTypeDispStrings.items():
                 itm = QListWidgetItem(self.tr(varTypeStr), widget)
                 itm.setData(Qt.UserRole, ConfigVarTypeFilters[varType])
+                itm.setFlags(Qt.ItemIsEnabled | Qt.ItemIsUserCheckable |
+                             Qt.ItemNeverHasChildren)
+                itm.setCheckState(Qt.Unchecked)
                 widget.addItem(itm)
         
         lDefaultFilter, gDefaultFilter = Preferences.getVarFilters()
@@ -62,13 +65,13 @@
         lList = []
         for row in range(self.localsList.count()):
             itm = self.localsList.item(row)
-            if itm.isSelected():
+            if itm.checkState() == Qt.Unchecked:
                 lList.append(itm.data(Qt.UserRole))
         
         gList = []
         for row in range(self.globalsList.count()):
             itm = self.globalsList.item(row)
-            if itm.isSelected():
+            if itm.checkState() == Qt.Unchecked:
                 gList.append(itm.data(Qt.UserRole))
         return (lList, gList)
     
@@ -81,11 +84,17 @@
         """
         for row in range(self.localsList.count()):
             itm = self.localsList.item(row)
-            itm.setSelected(itm.data(Qt.UserRole) in lList)
+            if itm.data(Qt.UserRole) in lList:
+                itm.setCheckState(Qt.Unchecked)
+            else:
+                itm.setCheckState(Qt.Checked)
         
         for row in range(self.globalsList.count()):
             itm = self.globalsList.item(row)
-            itm.setSelected(itm.data(Qt.UserRole) in gList)
+            if itm.data(Qt.UserRole) in gList:
+                itm.setCheckState(Qt.Unchecked)
+            else:
+                itm.setCheckState(Qt.Checked)
 
     def on_buttonBox_clicked(self, button):
         """

eric ide

mercurial