Beispiel #1
0
    def __init__(self, item):
        Exporter.__init__(self, item)
        tr = self.getTargetRect()
        if isinstance(item, QtGui.QGraphicsItem):
            scene = item.scene()
        else:
            scene = item
        # scene.views()[0].backgroundBrush()
        bgbrush = pg.mkBrush("w")
        bg = bgbrush.color()
        if bgbrush.style() == QtCore.Qt.NoBrush:
            bg.setAlpha(0)

        self.params = Parameter(
            name="params",
            type="group",
            children=[
                {
                    "name": "width",
                    "type": "int",
                    "value": tr.width(),
                    "limits": (0, None),
                },
                {
                    "name": "height",
                    "type": "int",
                    "value": tr.height(),
                    "limits": (0, None),
                },
                {
                    "name": "antialias",
                    "type": "bool",
                    "value": True
                },
                {
                    "name": "background",
                    "type": "color",
                    "value": bg
                },
            ],
        )
        self.params.param("width").sigValueChanged.connect(self.widthChanged)
        self.params.param("height").sigValueChanged.connect(self.heightChanged)
    def __init__(self, item):
        Exporter.__init__(self, item)

        # Exporter config options
        self.params = Parameter(name='params',
                                type='group',
                                children=[
                                    {
                                        'name': 'Data Type',
                                        'type': 'list',
                                        'value': 'int',
                                        'values': {
                                            'Default [Preserve Raw Type]':
                                            None,
                                            'float': np.float,
                                            'int': np.int,
                                        }
                                    },
                                ])
Beispiel #3
0
    def __init__(self, item):
        Exporter.__init__(self, item)
        tr = self.getTargetRect()
        if isinstance(item, QtGui.QGraphicsItem):
            scene = item.scene()
        else:
            scene = item
        # CHANGE: Used to be scene.views()[0].backgroundBrush()
        # That wasn't how to access the background of a GraphicsLayout object
        bgbrush = scene.backgroundBrush()
        bg = bgbrush.color()
        if bgbrush.style() == QtCore.Qt.NoBrush:
            bg.setAlpha(0)

        self.params = Parameter(name='params',
                                type='group',
                                children=[
                                    {
                                        'name': 'width',
                                        'type': 'int',
                                        'value': tr.width(),
                                        'limits': (0, None)
                                    },
                                    {
                                        'name': 'height',
                                        'type': 'int',
                                        'value': tr.height(),
                                        'limits': (0, None)
                                    },
                                    {
                                        'name': 'antialias',
                                        'type': 'bool',
                                        'value': True
                                    },
                                    {
                                        'name': 'background',
                                        'type': 'color',
                                        'value': bg
                                    },
                                ])

        self.params.param('width').sigValueChanged.connect(self.widthChanged)
        self.params.param('height').sigValueChanged.connect(self.heightChanged)
    def __init__(self, item, background_color):
        Exporter.__init__(self, item)
        tr = self.getTargetRect()
        if isinstance(item, QtGui.QGraphicsItem):
            scene = item.scene()
        else:
            scene = item
        if background_color == 'black':
            bgbrush = scene.views()[0].backgroundBrush()
        else:
            bgbrush = pg.mkBrush('w')
        bg = bgbrush.color()
        if bgbrush.style() == QtCore.Qt.NoBrush:
            bg.setAlpha(0)

        self.params = Parameter(name='params',
                                type='group',
                                children=[
                                    {
                                        'name': 'width',
                                        'type': 'int',
                                        'value': tr.width(),
                                        'limits': (0, None)
                                    },
                                    {
                                        'name': 'height',
                                        'type': 'int',
                                        'value': tr.height(),
                                        'limits': (0, None)
                                    },
                                    {
                                        'name': 'antialias',
                                        'type': 'bool',
                                        'value': True
                                    },
                                    {
                                        'name': 'background',
                                        'type': 'color',
                                        'value': bg
                                    },
                                ])
        self.params.param('width').sigValueChanged.connect(self.widthChanged)
        self.params.param('height').sigValueChanged.connect(self.heightChanged)