(self)
Clear the widget.
Clear the widget.
Clear the widget .
def clear(self):
        """
        Clear the widget.
        """
        scene = self.scene()
        if scene is not None:
            scene.removeItem(self._itemgroup)
        else:
            self._itemgroup.setParentItem(None)
        self._itemgroup = QGraphicsWidget(self)
        self._itemgroup.setGeometry(self.contentsRect())
        self._items.clear()

        for item in self._selection.values():
            if scene is not None:
                scene.removeItem(item)
            else:
                item.setParentItem(None)

        self._root = None
        self._items = {}
        self._selection = OrderedDict()
        self._highlighted_item = None
        self._cluster_parent = {}
        self.updateGeometry()
def clear ( self ) : scene = self . scene ( ) if scene is not None : scene . removeItem ( self . _itemgroup ) else : self . _itemgroup . setParentItem ( None ) self . _itemgroup = QGraphicsWidget ( self ) self . _itemgroup . setGeometry ( self . contentsRect ( ) ) self . _items . clear ( ) for item in self . _selection . values ( ) : if scene is not None : scene . removeItem ( item ) else : item . setParentItem ( None ) self . _root = None self . _items = { } self . _selection = OrderedDict ( ) self . _highlighted_item = None self . _cluster_parent = { } self . updateGeometry ( )