-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
61 lines (45 loc) · 1.46 KB
/
Copy pathmain.py
File metadata and controls
61 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# ZRC工具箱 - 主程序入口
# 集成系统工具的专业工具箱
import sys
import os
import time
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QTimer
# 确保导入路径正确
src_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src')
if src_path not in sys.path:
sys.path.insert(0, src_path)
from src.gui.main_window import ZRCMainWindow
from src.gui.splash_screen import SplashScreen
def main():
app = QApplication(sys.argv)
# 设置应用程序属性
app.setStyle('Fusion')
# LOGO文件路径
logo_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'assets', 'logo', 'zrc_logo_512x512.png')
# 创建并显示启动画面
splash = SplashScreen(logo_path)
splash.show()
# 模拟加载过程
loading_steps = [
"正在初始化界面...",
"正在加载模块...",
"正在准备工具...",
"启动完成!"
]
for step in loading_steps:
splash.update_loading_text(step)
app.processEvents()
time.sleep(0.7)
# 创建主窗口
window = ZRCMainWindow()
# 显示主窗口后关闭启动画面
def show_main_window():
window.show()
splash.fade_out(duration=800)
# 延迟一点时间让启动画面完全显示
QTimer.singleShot(200, show_main_window)
# 进入主事件循环
sys.exit(app.exec_())
if __name__ == "__main__":
main()