def __init__(self, mainwindow=None):
        super(DockWidgetOutputChannels, self).__init__()

        self.mainwindow = mainwindow

        self.setWindowTitle('Outputs')

        self.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea | QtCore.Qt.RightDockWidgetArea)
        self.setFeatures(self.DockWidgetFloatable | self.DockWidgetMovable)

        self.outputs = parse_outputs.get_outputs()

        widget = QtGui.QWidget()
        self.layout_outputs = QtGui.QVBoxLayout()

        for output in self.outputs:
            if output.output_enable:
                plugin_widget = outputwidget.OutputWidget(output=output, mainwindow=mainwindow)
                self.layout_outputs.addWidget(plugin_widget)

        widget.setLayout(self.layout_outputs)

        scroll = QtGui.QScrollArea()
        scroll.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        scroll.setWidgetResizable(False)
        scroll.setWidget(widget)

        container_layout = QtGui.QVBoxLayout()
        container_layout.addWidget(scroll)
        container_widget = QtGui.QWidget()
        container_widget.setLayout(container_layout)
        self.setWidget(container_widget)
Ejemplo n.º 2
0
    def __init__(self, node_object=None, output_object=None, port_id=None):
        super(Output, self).__init__()

        self.node_object = node_object

        self.output_object = output_object or parse_outputs.get_outputs()[random.randint(0, len(parse_outputs.get_outputs())-1)]

        self.color_item = QtGui.QColor(255, 0, 0)

        self.uuid = port_id or str(uuid.uuid4())

        self.setAcceptsHoverEvents(True)

        self.widget_title = QWidgetTitle()

        self.palette_temp = QtGui.QPalette()

        self.widget_title = None
        self.widget_title_proxy = None
        self.set_label()
        self.set_color()

        self.hovered = False

        self.rect = QtCore.QRectF(-SETTINGS.OUTPUT_RADIUS/2,
                                  -SETTINGS.OUTPUT_RADIUS/2,
                                  SETTINGS.OUTPUT_RADIUS,
                                  SETTINGS.OUTPUT_RADIUS)
Ejemplo n.º 3
0
 def setUpClass(cls):
     cls.output_objects = parse_outputs.get_outputs()