(PyQt) QTreeView - want to expand/collapse all children and grandchildren
问题 I want to be able to expand or collapse all children of a particular branch in a QTreeView. I am using PyQt4. I know that QTreeView's have an expand all children feature that is bound to *, but I need two things: It needs to be bound to a different key combination (shift-space) and I also need to be able to collapse all children as well. Here is what I have tried so far: I have a subclass of a QTreeView wherein I am checking for the shift-space key combo. I know that QModelIndex will let me