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 dropMimeData(self, parent, index, data, action):
      item = self.currentItem()
      p = parent
      # print "drop", item, "->", parent, index
      while True:
          if p is None:
              break
          if p is item:
              return False
              # raise Exception("Can not move item into itself.")
          p = p.parent()
  
      if not self.itemMoving(item, parent, index):
          return False
  
      currentParent = item.parent()
      if currentParent is None:
          currentParent = self.invisibleRootItem()
      if parent is None:
          parent = self.invisibleRootItem()
  
      if currentParent is parent and index > parent.indexOfChild(item):
          index -= 1
  
      self.prepareMove(item)
  
      currentParent.removeChild(item)
      # print "  insert child to index", index
      parent.insertChild(index, item)  ## index will not be correct
      self.setCurrentItem(item)
  
      self.recoverMove(item)
      # self.emit(QtCore.SIGNAL('itemMoved'), item, parent, index)
      self.sigItemMoved.emit(item, parent, index)
      return True
  
imports: from ..Qt import QtCore, QtWidgets
label_desc: Use image node_id 4 for calling the TreeWidget obj's underlying member method code with example usage: obj.dropMimeData(parent, index, data, action) and returns: True, False, False