pyqtgraph/MultiPlotWidget.py
Luke Campagnola 7629bca34d Updates merged in from ACQ4:
- converted most old-style signals into new-style for PySide compatibility (beware: API changes)
  - removed ObjectWorkaround, now just using QGraphicsWidget
  - performance enhancements, particularly in ROI.getArrayRegion
  - numerous bugfixes
2011-04-05 10:35:50 -04:00

43 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
"""
MultiPlotWidget.py - Convenience class--GraphicsView widget displaying a MultiPlotItem
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from GraphicsView import *
from MultiPlotItem import *
import exceptions
class MultiPlotWidget(GraphicsView):
"""Widget implementing a graphicsView with a single PlotItem inside."""
def __init__(self, parent=None):
GraphicsView.__init__(self, parent)
self.enableMouse(False)
self.mPlotItem = MultiPlotItem()
self.setCentralItem(self.mPlotItem)
## Explicitly wrap methods from mPlotItem
#for m in ['setData']:
#setattr(self, m, getattr(self.mPlotItem, m))
def __getattr__(self, attr): ## implicitly wrap methods from plotItem
if hasattr(self.mPlotItem, attr):
m = getattr(self.mPlotItem, attr)
if hasattr(m, '__call__'):
return m
raise exceptions.NameError(attr)
def widgetGroupInterface(self):
return (None, MultiPlotWidget.saveState, MultiPlotWidget.restoreState)
def saveState(self):
return {}
#return self.plotItem.saveState()
def restoreState(self, state):
pass
#return self.plotItem.restoreState(state)
def close(self):
self.mPlotItem.close()
self.setParent(None)