瀏覽代碼

SetQuitOnLastWindowClosed now False. Should prevent exit on Windows.

Thomas Buck 3 年之前
父節點
當前提交
a08c5d1e24
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3
    2
      src/octotray.py

+ 3
- 2
src/octotray.py 查看文件

@@ -18,7 +18,7 @@ import urllib.parse
18 18
 import urllib.request
19 19
 from os import path
20 20
 from PyQt5 import QtWidgets, QtGui, QtCore, QtNetwork
21
-from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu, QMessageBox, QWidget, QLabel, QVBoxLayout, QHBoxLayout, QDesktopWidget, QSizePolicy, QSlider, QLayout, QTableWidget, QTableWidgetItem, QPushButton
21
+from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu, QMessageBox, QWidget, QLabel, QVBoxLayout, QHBoxLayout, QDesktopWidget, QSizePolicy, QSlider, QLayout, QTableWidget, QTableWidgetItem, QPushButton, QApplication
22 22
 from PyQt5.QtGui import QIcon, QPixmap, QImageReader, QDesktopServices, QFontDatabase, QCursor
23 23
 from PyQt5.QtCore import QCoreApplication, QSettings, QUrl, QTimer, QSize, Qt, QSettings
24 24
 
@@ -871,7 +871,8 @@ class OctoTray():
871 871
         self.trayIcon.setVisible(False)
872 872
 
873 873
 if __name__ == "__main__":
874
-    app = QtWidgets.QApplication(sys.argv)
874
+    app = QApplication(sys.argv)
875
+    app.setQuitOnLastWindowClosed(False)
875 876
 
876 877
     tray = OctoTray(app)
877 878
     rc = app.exec_()

Loading…
取消
儲存