moved MDISubWindow to separate file

This commit is contained in:
2023-01-07 00:37:35 +01:00
parent 6918e66404
commit fc9d75cfba
2 changed files with 26 additions and 22 deletions

View File

@ -1,27 +1,6 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMdiSubWindow
import pyqtgraph as pg
from .. import assets
class MDISubWindow(QMdiSubWindow):
def __init__(self, title, *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)
def frame_on(self):
self.setWindowFlag(Qt.FramelessWindowHint, False)
def frame_off(self):
self.setWindowFlag(Qt.FramelessWindowHint, True)
from .mdisubwin import MDISubWindow
class MDISubPlot(MDISubWindow):

25
grum/mdi/mdisubwin.py Normal file
View File

@ -0,0 +1,25 @@
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMdiSubWindow
from .. import assets
class MDISubWindow(QMdiSubWindow):
def __init__(self, title, *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)
def frame_on(self):
self.setWindowFlag(Qt.FramelessWindowHint, False)
def frame_off(self):
self.setWindowFlag(Qt.FramelessWindowHint, True)