code: def destroy(self):
          
          self._teardown_features()
          focus_registry.unregister(self.widget)
          widget = self.widget
          if widget is not None:
              del self.widget
          super(QtGraphicsItem, self).destroy()
          # If a QWidgetAction was created for this widget, then it has
          # taken ownership of the widget and the widget will be deleted
          # when the QWidgetAction is garbage collected. This means the
          # superclass destroy() method must run before the reference to
          # the QWidgetAction is dropped.
          del self._widget_action
docs: Destroy the underlying QWidget object.