ScatterPlotSpeedTest: add toggle for drawPixmapFragments
This commit is contained in:
parent
380ec2e0b2
commit
ad3e3a6b8b
@ -24,6 +24,7 @@ param = ptree.Parameter.create(name=translate('ScatterPlot', 'Parameters'), type
|
||||
dict(name='count', title=translate('ScatterPlot', 'Count: '), type='int', limits=[1, None], value=500, step=100),
|
||||
dict(name='size', title=translate('ScatterPlot', 'Size: '), type='int', limits=[1, None], value=10),
|
||||
dict(name='randomize', title=translate('ScatterPlot', 'Randomize: '), type='bool', value=False),
|
||||
dict(name='_USE_PXFRAGS', title='_USE_PXFRAGS: ', type='bool', value=pyqtgraph.graphicsItems.ScatterPlotItem._USE_PXFRAGS),
|
||||
dict(name='_USE_QRECT', title='_USE_QRECT: ', type='bool', value=pyqtgraph.graphicsItems.ScatterPlotItem._USE_QRECT),
|
||||
dict(name='pxMode', title='pxMode: ', type='bool', value=True),
|
||||
dict(name='useCache', title='useCache: ', type='bool', value=True),
|
||||
@ -68,6 +69,7 @@ def mkDataAndItem():
|
||||
|
||||
def mkItem():
|
||||
global item
|
||||
pyqtgraph.graphicsItems.ScatterPlotItem._USE_PXFRAGS = param['_USE_PXFRAGS']
|
||||
pyqtgraph.graphicsItems.ScatterPlotItem._USE_QRECT = param['_USE_QRECT']
|
||||
item = pg.ScatterPlotItem(pxMode=param['pxMode'], **getData())
|
||||
item.opts['useCache'] = param['useCache']
|
||||
@ -122,7 +124,7 @@ def update():
|
||||
mkDataAndItem()
|
||||
for name in ['count', 'size']:
|
||||
param.child(name).sigValueChanged.connect(mkDataAndItem)
|
||||
for name in ['_USE_QRECT', 'useCache', 'pxMode', 'randomize']:
|
||||
for name in ['_USE_PXFRAGS', '_USE_QRECT', 'useCache', 'pxMode', 'randomize']:
|
||||
param.child(name).sigValueChanged.connect(mkItem)
|
||||
param.child('paused').sigValueChanged.connect(lambda _, v: timer.stop() if v else timer.start())
|
||||
timer.timeout.connect(update)
|
||||
|
Loading…
Reference in New Issue
Block a user