Skip to content

Commit ea033e2

Browse files
authored
Update gui.py
1 parent de614d6 commit ea033e2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gui.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@
5959
QHBoxLayout, QLabel, QLineEdit, QPushButton,
6060
QComboBox, QTextEdit, QCheckBox, QGroupBox,
6161
QMessageBox, QInputDialog, QSystemTrayIcon, QMenu, QAction)
62-
from PyQt5.QtCore import Qt, QThread, pyqtSignal, qRegisterMetaType
62+
from PyQt5.QtCore import Qt, QThread, pyqtSignal
6363
from PyQt5.QtGui import QIcon, QTextCursor
6464
HAS_PYQT = True
6565

6666
# 注册 QTextCursor 类型以避免信号槽错误
6767
try:
68+
from PyQt5.QtCore import qRegisterMetaType
6869
qRegisterMetaType('QTextCursor')
69-
except:
70+
except (ImportError, AttributeError):
71+
# qRegisterMetaType 在某些 PyQt5 版本中可能不可用,忽略
7072
pass
7173

7274
# 高 DPI 支持 - 必须在创建 QApplication 之前设置
@@ -80,7 +82,7 @@
8082
print("安装命令: pip3 install PyQt5")
8183
sys.exit(1)
8284

83-
APP_VERSION = "1.4"
85+
APP_VERSION = "1.3"
8486
APP_TITLE = f"ECH Workers 客户端 v{APP_VERSION}"
8587

8688
# 中国IP列表URL

0 commit comments

Comments
 (0)