introduced MDISubWindow

This commit is contained in:
2023-01-07 00:35:31 +01:00
parent 1d22b8dace
commit 6918e66404

View File

@ -5,9 +5,9 @@ import pyqtgraph as pg
from .. import assets
class MDISubPlot(QMdiSubWindow):
class MDISubWindow(QMdiSubWindow):
def __init__(self, title, desc, *args, **kwargs):
def __init__(self, title, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindowTitle(title)
self.setWindowIcon(assets.char())
@ -15,10 +15,6 @@ class MDISubPlot(QMdiSubWindow):
# without this, the SubWindow is not removed from the subWindowList
self.setAttribute(Qt.WA_DeleteOnClose)
plt = pg.PlotWidget()
self.plot = desc.make_plot(plt)
self.setWidget(plt)
def frame_on(self):
self.setWindowFlag(Qt.FramelessWindowHint, False)
@ -28,19 +24,22 @@ class MDISubPlot(QMdiSubWindow):
#TODO
class MDISubMultiPlot(MDISubPlot):
class MDISubPlot(MDISubWindow):
def __init__(self, title, desc, *args, **kwargs):
super().__init__(title, *args, **kwargs)
plt = pg.PlotWidget()
self.plot = desc.make_plot(plt)
self.setWidget(plt)
class MDISubMultiPlot(MDISubWindow):
def __init__(self, titles, descs, *args, **kwargs):
title = " | ".join(titles)
#TODO
QMdiSubWindow.__init__(self, *args, **kwargs)
self.setWindowTitle(title)
self.setWindowIcon(assets.char())
# without this, the SubWindow is not removed from the subWindowList
self.setAttribute(Qt.WA_DeleteOnClose)
super().__init__(title, *args, **kwargs)
plt = pg.PlotWidget()
self.plots = [d.make_plot(plt) for d in descs]