class_docstr: ParameterTree item with:
  
    * label in second column for displaying value
    * simple widget for editing value (displayed instead of label when item is selected)
    * button that resets value to default
  
  This class can be subclassed by overriding makeWidget() to provide a custom widget.
class_docstr_tok: ["ParameterTree","item","with",":","*","label","in","second","column","for","displaying","value","*","simple","widget","for","editing","value","(","displayed","instead","of","label","when","item","is","selected",")","*","button","that","resets","value","to","default","This","class","can","be","subclassed","by","overriding","makeWidget","(",")","to","provide","a","custom","widget","."]
code: def __init__(self, param, depth):
      ParameterItem.__init__(self, param, depth)
  
      self.asSubItem = (
          False  # place in a child item's column 0 instead of column 1
      )
      self.hideWidget = True  ## hide edit widget, replace with label when not selected
      ## set this to False to keep the editor widget always visible
  
      # build widget with a display label and default button
      w = self.makeWidget()
      self.widget = w
      self.eventProxy = EventProxy(w, self.widgetEventFilter)
  
      if self.asSubItem:
          self.subItem = QtWidgets.QTreeWidgetItem()
          self.subItem.depth = self.depth + 1
          self.subItem.setFlags(QtCore.Qt.ItemFlag.NoItemFlags)
          self.addChild(self.subItem)
  
      self.defaultBtn = self.makeDefaultButton()
  
      self.displayLabel = QtWidgets.QLabel()
  
      layout = QtWidgets.QHBoxLayout()
      layout.setContentsMargins(0, 0, 0, 0)
      layout.setSpacing(2)
      if not self.asSubItem:
          layout.addWidget(w, 1)
      layout.addWidget(self.displayLabel, 1)
      layout.addStretch(0)
      layout.addWidget(self.defaultBtn)
      self.layoutWidget = QtWidgets.QWidget()
      self.layoutWidget.setLayout(layout)
  
      if w.sigChanged is not None:
          w.sigChanged.connect(self.widgetValueChanged)
  
      if hasattr(w, "sigChanging"):
          w.sigChanging.connect(self.widgetValueChanging)
  
      ## update value shown in widget.
      opts = self.param.opts
      if opts.get("value", None) is not None:
          self.valueChanged(self, opts["value"], force=True)
      else:
          ## no starting value was given; use whatever the widget has
          self.widgetValueChanged()
  
      self.updateDefaultBtn()
  
      self.optsChanged(self.param, self.param.opts)
  
      # set size hints
      sw = self.widget.sizeHint()
      sb = self.defaultBtn.sizeHint()
      # shrink row heights a bit for more compact look
      sw.setHeight(int(sw.height() * 0.9))
      sb.setHeight(int(sb.height() * 0.9))
      if self.asSubItem:
          self.setSizeHint(1, sb)
          self.subItem.setSizeHint(0, sw)
      else:
          w = sw.width() + sb.width()
          h = max(sw.height(), sb.height())
          self.setSizeHint(1, QtCore.QSize(w, h))
  
imports: import builtins
  from ...None import functions
  from ...None import icons
  from ...Qt import QtCore, QtGui, QtWidgets, mkQApp
  from ..Parameter import Parameter
  from ..ParameterItem import ParameterItem
label_desc: Use image node_id 1 to create a new WidgetParameterItem object from inherited base classes: ParameterItem with example: obj = WidgetParameterItem(param, depth)