'Create and return a new node with a `QuickMenu`.'

def create_new(self, event):

    pos = event.screenPos()
    menu = self.document.quickMenu()
    node = self.scene.node_for_item(self.from_item)
    from_desc = node.description
    def is_compatible(source, sink):
        return any((scheme.compatible_channels(output, input) for output in source.outputs for input in sink.inputs))
    if (self.direction == self.FROM_SINK):
        is_compatible = reversed_arguments(is_compatible)
    def filter(index):
        desc = index.data(QtWidgetRegistry.WIDGET_DESC_ROLE)
        if isinstance(desc, WidgetDescription):
            return is_compatible(from_desc, desc)
        else:
            return False
    menu.setFilterFunc(filter)
    try:
        action = menu.exec_(pos)
    finally:
        menu.setFilterFunc(None)
    if action:
        item = action.property('item')
        desc = item.data(QtWidgetRegistry.WIDGET_DESC_ROLE)
        pos = event.scenePos()
        offset = (31 * ((-1) if (self.direction == self.FROM_SINK) else (1 if (self.direction == self.FROM_SOURCE) else 0)))
        node = self.document.newNodeHelper(desc, position=((pos.x() + offset), pos.y()))
        return node
