diff options
author | Blaine | 2020-04-21 17:27:43 +0530 |
---|---|---|
committer | Blaine | 2020-04-21 17:27:43 +0530 |
commit | 6416c34f957b2f0d2c5de318dc7023f9f67e9042 (patch) | |
tree | 16dc242407332870250c96b09836eb202c5c18b6 /src/main/python | |
parent | 20a3d0c0d2a2918ed7e424961edd08c5636f8162 (diff) | |
download | Chemical-PFD-6416c34f957b2f0d2c5de318dc7023f9f67e9042.tar.gz Chemical-PFD-6416c34f957b2f0d2c5de318dc7023f9f67e9042.tar.bz2 Chemical-PFD-6416c34f957b2f0d2c5de318dc7023f9f67e9042.zip |
fixed tab close
Diffstat (limited to 'src/main/python')
-rw-r--r-- | src/main/python/main.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/python/main.py b/src/main/python/main.py index fa615ff..c19e7c7 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -29,7 +29,7 @@ class appWindow(QMainWindow): mainLayout = QGridLayout(self.mainWidget) self.tabber = QTabWidget(self.mainWidget) self.tabber.setTabsClosable(True) - # QObject.connect(self.tabber, pyqtSignal(QTabWidget.tabCloseRequested(int)), self, pyqtSlot(QTabWidget.closetab(int))) + self.tabber.tabCloseRequested.connect(self.closeTab) # add close action to tabs self.createToolbar() mainLayout.addLayout(self.toolbar, 0, 0, -1, 1) @@ -37,7 +37,12 @@ class appWindow(QMainWindow): self.mainWidget.setLayout(mainLayout) self.setCentralWidget(self.mainWidget) - + + def closeTab(self, currentIndex): + #todo add save alert + self.tabber.widget(currentIndex).deleteLater() + self.tabber.removeTab(currentIndex) + def createToolbar(self): self.toolbar = QFormLayout(self.mainWidget) sizeComboBox = QComboBox() |