26 lines
826 B
Python
26 lines
826 B
Python
|
|
from PySide6.QtWidgets import QMainWindow
|
||
|
|
from Ui_install import Ui_MainWindows # 导入你的UI文件
|
||
|
|
from animations import LogoAnimations
|
||
|
|
|
||
|
|
class MainWindow(QMainWindow):
|
||
|
|
def __init__(self):
|
||
|
|
super().__init__()
|
||
|
|
# 设置UI
|
||
|
|
self.ui = Ui_MainWindows()
|
||
|
|
self.ui.setupUi(self)
|
||
|
|
|
||
|
|
# 初始化动画系统
|
||
|
|
self.logo_animations = LogoAnimations(self.ui)
|
||
|
|
|
||
|
|
# 窗口显示时自动启动动画
|
||
|
|
self.showEvent = self.on_show_event
|
||
|
|
|
||
|
|
def on_show_event(self, event):
|
||
|
|
"""窗口显示事件处理"""
|
||
|
|
self.logo_animations.start_animation()
|
||
|
|
super().showEvent(event)
|
||
|
|
|
||
|
|
def closeEvent(self, event):
|
||
|
|
"""窗口关闭事件处理"""
|
||
|
|
self.logo_animations.stop_animation()
|
||
|
|
super().closeEvent(event)
|