Exemplo n.º 1
0
    def __init__(self, parent=None):
        super(FactoryView, self).__init__(parent)

        self.layout = QVBoxLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)

        self.scene = FactoryScene()
        self.grScene = self.scene.grScene
        self.view = QDMGraphicsView(self.grScene)

        splitter1 = QSplitter(Qt.Vertical)
        splitter1.addWidget(self.view)

        self.node = FactoryNode(self.scene)

        sockethandler = FactorySocketHandler(self.node)
        sockethandler.socket_added.connect(self.node.grNode.adjust_socket_pos)
        highlighter = KelebekSyntaxHighlighter(sockethandler)
        options = FactoryNodeOptions(self.node)

        splitter2 = QSplitter(Qt.Horizontal)
        splitter2.addWidget(options)
        splitter2.addWidget(highlighter)
        splitter2.addWidget(sockethandler)
        splitter2.setStretchFactor(0, 1)
        splitter2.setStretchFactor(1, 4)
        splitter2.setStretchFactor(2, 14)
        splitter1.addWidget(splitter2)

        self.layout.addWidget(splitter1)
        highlighter.save_signal.connect(self.saveNode)
        highlighter.emit_eval.connect(self.eval_text)

        self.scene.addDragEnterListener(self.onDragEnter)
        self.scene.addDropListener(self.onDrop)
    def initUI(self):
        self.layout = QVBoxLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        # crate graphics scene
        self.scene = Scene()

        # create graphics view
        self.view = QDMGraphicsView(self.scene.grScene, self)
        self.layout.addWidget(self.view)
Exemplo n.º 3
0
    def initUI(self):
        """Set up this ``NodeEditorWidget`` with its layout,  :class:`~nodeeditor.node_scene.Scene` and
        :class:`~nodeeditor.node_graphics_view.QDMGraphicsView`"""
        self.layout = QVBoxLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        # crate graphics scene
        self.scene = Scene()

        # create graphics view
        self.view = QDMGraphicsView(self.scene.grScene, self)
        self.layout.addWidget(self.view)