moved MDISubPlot to separate file

This commit is contained in:
2022-12-19 13:48:02 +01:00
parent 03beb10c4b
commit 21507b8c12
3 changed files with 25 additions and 20 deletions

View File

@ -3,7 +3,8 @@ from PyQt5.QtWidgets import QMainWindow, QSplitter
import assets
from dictlist import DictList
from mdi import MDIArea, MDISubPlot
from mdiarea import MDIArea
from mdisubplot import MDISubPlot
from rpcserverthread import RPCServerThread
from plotdesc import PlotDescription
from exampledata import exampledata

View File

@ -1,7 +1,5 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMdiArea, QMdiSubWindow, QAction
from PyQt5.QtWidgets import QMdiArea, QAction
from PyQt5.QtGui import QPainter
import pyqtgraph as pg
import assets
from theme import MDI_BKG
@ -69,19 +67,3 @@ class MDIArea(QMdiArea):
class MDISubPlot(QMdiSubWindow):
def __init__(self, title, desc, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindowTitle(title)
self.setWindowIcon(assets.char())
# 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)

22
mdisubplot.py Normal file
View File

@ -0,0 +1,22 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMdiSubWindow
import pyqtgraph as pg
import assets
class MDISubPlot(QMdiSubWindow):
def __init__(self, title, desc, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindowTitle(title)
self.setWindowIcon(assets.char())
# 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)