Esempio n. 1
0
 def resolve_item_down_changed(self, item: QObject) -> None:
     """Put the same state for every child."""
     self.update_item_changed(item)
     state = item.checkState()
     for idx in range(item.rowCount()):
         child = item.child(idx)
         child.setCheckState(state)
         self.resolve_item_down_changed(child)
Esempio n. 2
0
 def resolve_item_down_changed(self, item: QObject) -> None:
     """ Put the same state for every child. """
     self.update_item_changed(item)
     state = item.checkState()
     for idx in range(item.rowCount()):
         child = item.child(idx)
         child.setCheckState(state)
         self.resolve_item_down_changed(child)
Esempio n. 3
0
 def item_check_parent(self, item: QObject) -> None:
     sum_states = sum(
         item.child(idx).checkState() == Qt.Checked for idx in range(item.rowCount())
     )
     if sum_states == item.rowCount():
         item.setCheckState(Qt.Checked)
     else:
         item.setCheckState(Qt.PartiallyChecked)
     self.resolve_item_up_changed(item)
Esempio n. 4
0
 def item_check_parent(self, item: QObject) -> None:
     sum_states = sum(
         item.child(idx).checkState() == Qt.Checked for idx in range(item.rowCount())
     )
     if sum_states == item.rowCount():
         item.setCheckState(Qt.Checked)
     else:
         item.setCheckState(Qt.PartiallyChecked)
     self.resolve_item_up_changed(item)
Esempio n. 5
0
 def item_check_parent(self, item: QObject) -> None:
     """Retrieve the state of all children to update its own state accordingly."""
     sum_states = sum(
         item.child(idx).checkState() == Qt.Checked
         for idx in range(item.rowCount()))
     if sum_states == item.rowCount():
         item.setCheckState(Qt.Checked)
     else:
         item.setCheckState(Qt.PartiallyChecked)
     self.resolve_item_up_changed(item)