MCPcopy Create free account
hub / github.com/PyQt5/PyQt / New__init__

Function New__init__

PyQtGraph/tools.py:29–48  ·  view source on GitHub ↗
(self, item)

Source from the content-addressed store, hash-verified

27
28
29def New__init__(self, item):
30 Exporter.__init__(self, item)
31 tr = self.getTargetRect()
32 if isinstance(item, pg.Qt.QtGui.QGraphicsItem):
33 scene = item.scene()
34 else:
35 scene = item
36 bgbrush = scene.views()[0].backgroundBrush()
37 bg = bgbrush.color()
38 if bgbrush.style() == pg.Qt.QtCore.Qt.NoBrush:
39 bg.setAlpha(0)
40
41 self.params = Parameter(name='params', type='group', children=[
42 {'name': 'width', 'type': 'int', 'value': int(tr.width()), 'limits': (0, None)},
43 {'name': 'height', 'type': 'int', 'value': int(tr.height()), 'limits': (0, None)},
44 {'name': 'antialias', 'type': 'bool', 'value': True},
45 {'name': 'background', 'type': 'color', 'value': bg},
46 ])
47 self.params.param('width').sigValueChanged.connect(self.widthChanged)
48 self.params.param('height').sigValueChanged.connect(self.heightChanged)
49
50
51ImageExporter.heightChanged = heightChanged

Callers

nothing calls this directly

Calls 4

__init__Method · 0.45
colorMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected