'Clear the editor state (source and sink nodes, channels ...).'

def clear(self):

    if self.layout().count():
        widget = self.layout().takeAt(0).graphicsItem()
        self.removeItems([widget])
    self.source = None
    self.sink = None
