Restore the now-deprecated PlotWindow and ImageWindow classes

This commit is contained in:
Ogi 2020-06-11 20:55:28 -07:00
parent 12a7c449f1
commit 4dc0865bae

View File

@ -55,10 +55,14 @@ class PlotWindow(PlotWidget):
""" """
def __init__(self, title=None, **kargs): def __init__(self, title=None, **kargs):
mkQApp() mkQApp()
self.win = QtGui.QMainWindow()
PlotWidget.__init__(self, **kargs) PlotWidget.__init__(self, **kargs)
self.win.setCentralWidget(self)
for m in ['resize']:
setattr(self, m, getattr(self.win, m))
if title is not None: if title is not None:
self.setWindowTitle(title) self.win.setWindowTitle(title)
self.show() self.win.show()
def closeEvent(self, event): def closeEvent(self, event):
PlotWidget.closeEvent(self, event) PlotWidget.closeEvent(self, event)
@ -73,13 +77,19 @@ class ImageWindow(ImageView):
""" """
def __init__(self, *args, **kargs): def __init__(self, *args, **kargs):
mkQApp() mkQApp()
ImageView.__init__(self) self.win = QtGui.QMainWindow()
self.win.resize(800,600)
if 'title' in kargs: if 'title' in kargs:
self.setWindowTitle(kargs['title']) self.win.setWindowTitle(kargs['title'])
del kargs['title'] del kargs['title']
ImageView.__init__(self, self.win)
if len(args) > 0 or len(kargs) > 0: if len(args) > 0 or len(kargs) > 0:
self.setImage(*args, **kargs) self.setImage(*args, **kargs)
self.show()
self.win.setCentralWidget(self)
for m in ['resize']:
setattr(self, m, getattr(self.win, m))
self.win.show()
def closeEvent(self, event): def closeEvent(self, event):
ImageView.closeEvent(self, event) ImageView.closeEvent(self, event)