Recursively change children's check state when an item check state is changed

Sun, 14 Jul 2019 17:00:44 -0400

author
Mikhail Terekhov
date
Sun, 14 Jul 2019 17:00:44 -0400
changeset 7073
e86027967f5c
parent 7072
66ef92f769bf
child 7074
7da5a5a14469

Recursively change children's check state when an item check state is changed
in unittest discoveryList.

eric6/PyUnit/UnittestDialog.py file | annotate | diff | comparison | revisions
diff -r 66ef92f769bf -r e86027967f5c eric6/PyUnit/UnittestDialog.py
--- a/eric6/PyUnit/UnittestDialog.py	Sun Jul 14 16:46:46 2019 -0400
+++ b/eric6/PyUnit/UnittestDialog.py	Sun Jul 14 17:00:44 2019 -0400
@@ -625,6 +625,20 @@
             )
     
     @pyqtSlot(QTreeWidgetItem, int)
+    def on_discoveryList_itemChanged(self, item, column):
+        """
+        Private slot handling the user checking or unchecking an item.
+
+        @param item reference to the item
+        @type QTreeWidgetItem
+        @param column changed column
+        @type int
+        """
+        if column == 0:
+            for index in range(item.childCount()):
+                item.child(index).setCheckState(0, item.checkState(0))
+
+    @pyqtSlot(QTreeWidgetItem, int)
     def on_discoveryList_itemDoubleClicked(self, item, column):
         """
         Private slot handling the user double clicking an item.

eric ide

mercurial