class_docstr: Extends QTreeWidget to allow internal drag/drop with widgets in the tree.
  Also maintains the expanded state of subtrees as they are moved.
  This class demonstrates the absurd lengths one must go to to make drag/drop work.
class_docstr_tok: ["Extends","QTreeWidget","to","allow","internal","drag\/drop","with","widgets","in","the","tree",".","Also","maintains","the","expanded","state","of","subtrees","as","they","are","moved",".","This","class","demonstrates","the","absurd","lengths","one","must","go","to","to","make","drag\/drop","work","."]
code: def updateDropFlags(self):
      ### intended to put a limit on how deep nests of children can go.
      ### self.childNestingLimit is upheld when moving items without children, but if the item being moved has children/grandchildren, the children/grandchildren
      ### can end up over the childNestingLimit.
      if self.childNestingLimit is None:
          pass  # enable drops in all items (but only if there are drops that aren't enabled? for performance...)
      else:
          items = self.listAllItems()
          for item in items:
              parentCount = 0
              p = item.parent()
              while p is not None:
                  parentCount += 1
                  p = p.parent()
              if parentCount >= self.childNestingLimit:
                  item.setFlags(
                      item.flags()
                      & (~QtCore.Qt.ItemFlag.ItemIsDropEnabled)
                  )
              else:
                  item.setFlags(
                      item.flags()
                      | QtCore.Qt.ItemFlag.ItemIsDropEnabled
                  )
  
imports: from ..Qt import QtCore, QtWidgets
label_desc: Use image node_id 12 for calling the TreeWidget obj's underlying member method code with example usage: obj.updateDropFlags() without return types