Exemple #1
0
class VariablesTool(DockTool):
    """docstring for Variables tool."""
    def __init__(self):
        super(VariablesTool, self).__init__()
        self.setMinimumSize(QtCore.QSize(200, 50))
        self.content = QWidget()
        self.content.setObjectName("VariablesToolContent")
        self.verticalLayout = QVBoxLayout(self.content)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.setWidget(self.content)

    @staticmethod
    def getIcon():
        return QtGui.QIcon(RESOURCES_DIR + "/variable.png")

    @staticmethod
    def isSingleton():
        return True

    def onShow(self):
        super(VariablesTool, self).onShow()
        self.verticalLayout.addWidget(VariablesWidget(self.canvas))

    @staticmethod
    def toolTip():
        return "Variables editing/creation"

    @staticmethod
    def name():
        return str("Variables")
Exemple #2
0
class VariablesTool(DockTool):
    """docstring for Variables tool."""
    def __init__(self):
        super(VariablesTool, self).__init__()
        self.setMinimumSize(QtCore.QSize(200, 50))
        self.content = QWidget()
        self.content.setObjectName("VariablesToolContent")
        self.verticalLayout = QVBoxLayout(self.content)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.setWidget(self.content)

    @staticmethod
    def getIcon():
        return QtGui.QIcon(":variable.png")

    @staticmethod
    def isSingleton():
        return True

    def onShow(self):
        super(VariablesTool, self).onShow()
        varsWidget = VariablesWidget(self.pyFlowInstance)
        self.pyFlowInstance.fileBeenLoaded.connect(varsWidget.actualize)
        self.verticalLayout.addWidget(varsWidget)

    @staticmethod
    def toolTip():
        return "Variables editing/creation"

    @staticmethod
    def name():
        return str("Variables")
Exemple #3
0
class HistoryTool(DockTool):
    """docstring for History tool."""
    def __init__(self):
        super(HistoryTool, self).__init__()
        self.setMinimumSize(QtCore.QSize(200, 50))
        self.content = QWidget()
        self.content.setObjectName("historyToolContent")
        self.verticalLayout = QVBoxLayout(self.content)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.undoStackView = QUndoView(self)
        self.undoStackView.setObjectName("undoStackView")
        self.verticalLayout.addWidget(self.undoStackView)
        self.setWidget(self.content)

    @staticmethod
    def getIcon():
        return QtGui.QIcon(RESOURCES_DIR + "/history.png")

    def onShow(self):
        super(HistoryTool, self).onShow()
        self.undoStackView.setStack(self.canvas.undoStack)

    @staticmethod
    def defaultDockArea():
        return QtCore.Qt.LeftDockWidgetArea

    @staticmethod
    def toolTip():
        return "Undo stack"

    @staticmethod
    def name():
        return str("History")
Exemple #4
0
    def ui(self):
        super(MenuTabWidget, self).ui()

        self.tool_btn_grp = MenuTabBlockButtonGroup()

        bar_widget = QWidget()
        bar_widget.setObjectName('bar_widget')
        self._bar_layout = layouts.HorizontalLayout(margins=(10, 0, 10, 0))
        bar_widget.setLayout(self._bar_layout)
        self._bar_layout.addWidget(self.tool_btn_grp)
        self._bar_layout.addStretch()

        self.main_layout.addWidget(bar_widget)
        self.main_layout.addWidget(dividers.Divider())
        self.main_layout.addSpacing(5)