Commit 58765476717bc16d96db3c46c47854de36d09b26
1 parent
a15fba68b0
Exists in
master
datalogger-gui: stop properly when close with X button
Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff
datalogger-gui.py
| ... | ... | @@ -131,7 +131,15 @@ |
| 131 | 131 | |
| 132 | 132 | def runApp(self): |
| 133 | 133 | self.w.show() |
| 134 | + self.a.aboutToQuit.connect(self.closeEvent) | |
| 134 | 135 | sys.exit(self.a.exec_()) |
| 136 | + | |
| 137 | + def closeEvent(self): | |
| 138 | + try: | |
| 139 | + self.stopLog() | |
| 140 | + except: | |
| 141 | + pass | |
| 142 | + print('Done') | |
| 135 | 143 | |
| 136 | 144 | @pyqtSlot() |
| 137 | 145 | def updateSignal(self): |