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","."]
docstr: Overrides QTreeWidget.setItemWidget such that widgets are added inside an invisible wrapper widget.
  This makes it possible to move the item in and out of the tree without its widgets being automatically deleted.
docstr_tok: ["Overrides","QTreeWidget.setItemWidget","such","that","widgets","are","added","inside","an","invisible","wrapper","widget",".","This","makes","it","possible","to","move","the","item","in","and","out","of","the","tree","without","its","widgets","being","automatically","deleted","."]
code: def setItemWidget(self, item, col, wid):
      """
      Overrides QTreeWidget.setItemWidget such that widgets are added inside an invisible wrapper widget.
      This makes it possible to move the item in and out of the tree without its widgets being automatically deleted.
      """
      w = QtWidgets.QWidget()  ## foster parent / surrogate child widget
      l = QtWidgets.QVBoxLayout()
      l.setContentsMargins(0, 0, 0, 0)
      w.setLayout(l)
      w.setSizePolicy(wid.sizePolicy())
      w.setMinimumHeight(wid.minimumHeight())
      w.setMinimumWidth(wid.minimumWidth())
      l.addWidget(wid)
      w.realChild = wid
      self.placeholders.append(w)
      QtWidgets.QTreeWidget.setItemWidget(self, item, col, w)
  
imports: from ..Qt import QtCore, QtWidgets
label_desc: Use image node_id 2 for calling the TreeWidget obj's underlying member method code with example usage: obj.setItemWidget(item, col, wid) without return types