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

        self.mainwindow = mainwindow

        self.setWindowTitle('Plugins')

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

        self.plugins = parse_plugins.get_plugins()

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

        for plugin in self.plugins:
            if plugin.family_enable:
                if SETTINGS.DISPLAY_ONLY_AVAILABLE and plugin.executable_x32 is None and plugin.executable_x64 is None:
                    pass
                else:
                    plugin_widget = pluginwidget.PluginWidget(plugin=plugin, mainwindow=mainwindow)
                    self.layout_plugins.addWidget(plugin_widget)

        widget.setLayout(self.layout_plugins)

        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)
示例#2
0
    def setUpClass(cls):

        cls.plugins = parse_plugins.get_plugins()
# import src.conf.settings.SETTINGS as SETTINGS
# import src.modules.ui.graphicsscene.graphicsscene as graphicsscene
import pypelyne2.src.modules.ui.graphicsview.graphicsview_stage as graphicsview_stage
import pypelyne2.src.modules.ui.nodegraphicsitem.nodegraphicsitem as nodegraphicsitem
import pypelyne2.src.parser.parse_plugins as parse_plugins


app = QtGui.QApplication(sys.argv)

mainwindow = QtGui.QMainWindow()
scene = QtGui.QGraphicsScene()
graphicssview_stage = graphicsview_stage.GraphicsViewStage()
graphicssview_stage.setScene(scene)
mainwindow.setCentralWidget(graphicssview_stage)

plugins = parse_plugins.get_plugins()

for attribute in dir(plugins[0]):
    print '%s = %s' % (attribute, getattr(plugins[1].x64, attribute))

node_graphics_item_x32 = nodegraphicsitem.NodeGraphicsItem(position=QtCore.QPoint(0, 0), plugin=plugins[1].x32)
# node_graphics_item_x64 = nodegraphicsitem.NodeGraphicsItem(position=QtCore.QPoint(10, 10), plugin=plugins[2].x64)
# node_graphics_item_submitter = nodegraphicsitem.NodeGraphicsItem(position=QtCore.QPoint(20, 20), plugin=plugins[2].submitter)

node_graphics_item_x32.collapse_layout()
# node_graphics_item_x64.expand_layout()
# node_graphics_item_submitter.expand_layout()

scene.addItem(node_graphics_item_x32)
# scene.addItem(node_graphics_item_x64)
# scene.addItem(node_graphics_item_submitter)