<div dir="ltr">Hi,<div><br></div><div>I have a QListView, I also have a separate checkbox to do selectAll, deselectAll functionality, and It's working. but I am missing one thing, when I do selectAll, then deselect one item, The SelectAll checkbox should be cleared. I have been trying to figure out a way to do that but can't find the right way to do It.</div>
<div><br></div><div>Here is what I have done so far:</div><div><br></div><div>I have conntected the listView.selectionModel() 'selectionChanged' signal to toggle_groups_checkbox, In there I try to print the count of deselected items, and if it's more than 0 I clear the checkbox, but printing the count of deselected_items is not accurate, when I do selectAll it prints many values, one of them deselectedItems is 1... that would make me clear the checkbox, which is wrong. I think there is a better way to do that, so any guidance would be appreciated.</div>
<div><br></div><div>self.connect(self.ui.listView_gateway_groups.selectionModel (), SIGNAL("selectionChanged(const QItemSelection&,const QItemSelection&)"),</div><div><div> self.toggle_groups_checkbox)</div>
</div><div><br></div><div><div>def toggle_groups_checkbox(self, set_selection, clear_selection):</div><div> print set_selection.count()</div><div> print clear_selection.count()</div></div><div><br></div></div>