added and use constants for default sub window size
This commit is contained in:
@ -4,12 +4,17 @@ from PyQt5.QtWidgets import QMdiSubWindow
|
|||||||
from .. import assets
|
from .. import assets
|
||||||
|
|
||||||
|
|
||||||
|
SUB_WIN_WIDTH = 640
|
||||||
|
SUB_WIN_HEIGHT = 480
|
||||||
|
|
||||||
|
|
||||||
class MDISubWindow(QMdiSubWindow):
|
class MDISubWindow(QMdiSubWindow):
|
||||||
|
|
||||||
def __init__(self, title, *args, **kwargs):
|
def __init__(self, title, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.setWindowTitle(title)
|
self.setWindowTitle(title)
|
||||||
self.setWindowIcon(assets.char())
|
self.setWindowIcon(assets.char())
|
||||||
|
self.resize(SUB_WIN_WIDTH, SUB_WIN_HEIGHT)
|
||||||
|
|
||||||
# without this, the SubWindow is not removed from the subWindowList
|
# without this, the SubWindow is not removed from the subWindowList
|
||||||
self.setAttribute(Qt.WA_DeleteOnClose)
|
self.setAttribute(Qt.WA_DeleteOnClose)
|
||||||
|
Reference in New Issue
Block a user