moved MDISubPlot to separate file
This commit is contained in:
@ -3,7 +3,8 @@ from PyQt5.QtWidgets import QMainWindow, QSplitter
|
|||||||
|
|
||||||
import assets
|
import assets
|
||||||
from dictlist import DictList
|
from dictlist import DictList
|
||||||
from mdi import MDIArea, MDISubPlot
|
from mdiarea import MDIArea
|
||||||
|
from mdisubplot import MDISubPlot
|
||||||
from rpcserverthread import RPCServerThread
|
from rpcserverthread import RPCServerThread
|
||||||
from plotdesc import PlotDescription
|
from plotdesc import PlotDescription
|
||||||
from exampledata import exampledata
|
from exampledata import exampledata
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtWidgets import QMdiArea, QAction
|
||||||
from PyQt5.QtWidgets import QMdiArea, QMdiSubWindow, QAction
|
|
||||||
from PyQt5.QtGui import QPainter
|
from PyQt5.QtGui import QPainter
|
||||||
import pyqtgraph as pg
|
|
||||||
|
|
||||||
import assets
|
import assets
|
||||||
from theme import MDI_BKG
|
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
22
mdisubplot.py
Normal 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user