* Fixed application not exiting cleanly, when main window is closed while child proce...
authorUrban Wallasch <urban.wallasch@freenet.de>
Sun, 9 May 2021 15:10:09 +0000 (17:10 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Sun, 9 May 2021 15:10:09 +0000 (17:10 +0200)
ffpreview.py

index 5fdfc7c100df9e8b31472a3d91acfa5ed5164e24..0fe02005366c9425e4832a5d73d4e4576b013829 100755 (executable)
@@ -404,12 +404,19 @@ class tLabel(QWidget):
         elif action == quit_action:
             die()
 
+class sMainWindow(QMainWindow):
+    def __init__(self, *args, pixmap=None, text=None, info=None, **kwargs):
+        super().__init__(*args, **kwargs)
+    def closeEvent(self, event):
+        self.close()
+        die()
+
 app = QApplication(sys.argv)
 app.setApplicationName('ffpreview')
 clipboard = QApplication.clipboard()
 broken_img = sQPixmap(imgdata=broken_img_png)
 ffpreview_ico = sQIcon(imgdata=ffpreview_png)
-root = QMainWindow()
+root = sMainWindow()
 root.setWindowTitle('ffpreview - ' + cfg['vid'])
 root.resize(500, 300)
 root.setWindowIcon(ffpreview_ico)