update:测试UI
BIN
IMG/After/voaf_ga01.jpg
Executable file
|
After Width: | Height: | Size: 162 KiB |
BIN
IMG/After/voaf_ga02.jpg
Executable file
|
After Width: | Height: | Size: 179 KiB |
BIN
IMG/BG/bg1.jpg
Executable file
|
After Width: | Height: | Size: 442 KiB |
BIN
IMG/BG/bg2.jpg
Executable file
|
After Width: | Height: | Size: 250 KiB |
BIN
IMG/LOGO/gl_head_logo_jp.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
IMG/LOGO/vo01_logo.png
Executable file
|
After Width: | Height: | Size: 51 KiB |
BIN
IMG/LOGO/vo02_logo.png
Executable file
|
After Width: | Height: | Size: 50 KiB |
BIN
IMG/LOGO/vo03_logo.png
Executable file
|
After Width: | Height: | Size: 177 KiB |
BIN
IMG/LOGO/vo04_logo.png
Executable file
|
After Width: | Height: | Size: 52 KiB |
BIN
IMG/LOGO/voaf_logo.png
Executable file
|
After Width: | Height: | Size: 327 KiB |
BIN
IMG/vol4/vo04_ga01.jpg
Executable file
|
After Width: | Height: | Size: 166 KiB |
BIN
IMG/vol4/vo04_ga05.jpg
Executable file
|
After Width: | Height: | Size: 184 KiB |
BIN
IMG/vol4/vo04_ga06.jpg
Executable file
|
After Width: | Height: | Size: 197 KiB |
BIN
IMG/vol4/vo04_ga07.jpg
Executable file
|
After Width: | Height: | Size: 166 KiB |
105
Ui_install.py
Normal file
@@ -0,0 +1,105 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'install.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.9.1
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
|
||||
QCursor, QFont, QFontDatabase, QGradient,
|
||||
QIcon, QImage, QKeySequence, QLinearGradient,
|
||||
QPainter, QPalette, QPixmap, QRadialGradient,
|
||||
QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QMainWindow, QMenu,
|
||||
QMenuBar, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_MainWindows(object):
|
||||
def setupUi(self, MainWindows):
|
||||
if not MainWindows.objectName():
|
||||
MainWindows.setObjectName(u"MainWindows")
|
||||
MainWindows.setEnabled(True)
|
||||
MainWindows.resize(1024, 576)
|
||||
MainWindows.setMinimumSize(QSize(1024, 576))
|
||||
MainWindows.setMaximumSize(QSize(1024, 576))
|
||||
MainWindows.setMouseTracking(False)
|
||||
MainWindows.setTabletTracking(False)
|
||||
MainWindows.setAcceptDrops(True)
|
||||
MainWindows.setAutoFillBackground(True)
|
||||
MainWindows.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly)
|
||||
MainWindows.setAnimated(True)
|
||||
MainWindows.setDocumentMode(False)
|
||||
MainWindows.setDockNestingEnabled(False)
|
||||
self.action_2 = QAction(MainWindows)
|
||||
self.action_2.setObjectName(u"action_2")
|
||||
self.centralwidget = QWidget(MainWindows)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
self.centralwidget.setAutoFillBackground(True)
|
||||
self.MainBg = QLabel(self.centralwidget)
|
||||
self.MainBg.setObjectName(u"MainBg")
|
||||
self.MainBg.setGeometry(QRect(0, 0, 1031, 561))
|
||||
self.MainBg.setPixmap(QPixmap(u"IMG/BG/bg2.jpg"))
|
||||
self.MainBg.setScaledContents(True)
|
||||
self.vol1bg = QLabel(self.centralwidget)
|
||||
self.vol1bg.setObjectName(u"vol1bg")
|
||||
self.vol1bg.setGeometry(QRect(0, 250, 93, 64))
|
||||
self.vol1bg.setPixmap(QPixmap(u"IMG/LOGO/vo01_logo.png"))
|
||||
self.vol1bg.setScaledContents(True)
|
||||
self.vol2bg = QLabel(self.centralwidget)
|
||||
self.vol2bg.setObjectName(u"vol2bg")
|
||||
self.vol2bg.setGeometry(QRect(0, 310, 93, 64))
|
||||
self.vol2bg.setPixmap(QPixmap(u"IMG/LOGO/vo02_logo.png"))
|
||||
self.vol2bg.setScaledContents(True)
|
||||
self.vol3bg = QLabel(self.centralwidget)
|
||||
self.vol3bg.setObjectName(u"vol3bg")
|
||||
self.vol3bg.setGeometry(QRect(0, 370, 93, 64))
|
||||
self.vol3bg.setPixmap(QPixmap(u"IMG/LOGO/vo03_logo.png"))
|
||||
self.vol3bg.setScaledContents(True)
|
||||
self.vol4bg = QLabel(self.centralwidget)
|
||||
self.vol4bg.setObjectName(u"vol4bg")
|
||||
self.vol4bg.setGeometry(QRect(0, 430, 93, 64))
|
||||
self.vol4bg.setPixmap(QPixmap(u"IMG/LOGO/vo04_logo.png"))
|
||||
self.vol4bg.setScaledContents(True)
|
||||
self.afterbg = QLabel(self.centralwidget)
|
||||
self.afterbg.setObjectName(u"afterbg")
|
||||
self.afterbg.setGeometry(QRect(0, 490, 93, 64))
|
||||
self.afterbg.setPixmap(QPixmap(u"IMG/LOGO/voaf_logo.png"))
|
||||
self.afterbg.setScaledContents(True)
|
||||
MainWindows.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QMenuBar(MainWindows)
|
||||
self.menubar.setObjectName(u"menubar")
|
||||
self.menubar.setGeometry(QRect(0, 0, 1024, 21))
|
||||
self.menu = QMenu(self.menubar)
|
||||
self.menu.setObjectName(u"menu")
|
||||
self.menu_2 = QMenu(self.menubar)
|
||||
self.menu_2.setObjectName(u"menu_2")
|
||||
MainWindows.setMenuBar(self.menubar)
|
||||
|
||||
self.menubar.addAction(self.menu.menuAction())
|
||||
self.menubar.addAction(self.menu_2.menuAction())
|
||||
self.menu.addSeparator()
|
||||
self.menu.addAction(self.action_2)
|
||||
|
||||
self.retranslateUi(MainWindows)
|
||||
|
||||
QMetaObject.connectSlotsByName(MainWindows)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainWindows):
|
||||
MainWindows.setWindowTitle(QCoreApplication.translate("MainWindows", u" UI Test", None))
|
||||
self.action_2.setText(QCoreApplication.translate("MainWindows", u"update - sd", None))
|
||||
self.MainBg.setText("")
|
||||
self.vol1bg.setText("")
|
||||
self.vol2bg.setText("")
|
||||
self.vol3bg.setText("")
|
||||
self.vol4bg.setText("")
|
||||
self.afterbg.setText("")
|
||||
self.menu.setTitle(QCoreApplication.translate("MainWindows", u"\u8bbe\u7f6e", None))
|
||||
self.menu_2.setTitle(QCoreApplication.translate("MainWindows", u"\u5173\u4e8e", None))
|
||||
# retranslateUi
|
||||
|
||||
BIN
__pycache__/Ui_install.cpython-310.pyc
Normal file
BIN
__pycache__/animations.cpython-310.pyc
Normal file
BIN
__pycache__/main_window.cpython-310.pyc
Normal file
72
animations.py
Normal file
@@ -0,0 +1,72 @@
|
||||
from PySide6.QtCore import (QPropertyAnimation, QSequentialAnimationGroup,
|
||||
QParallelAnimationGroup, QPoint, QEasingCurve)
|
||||
from PySide6.QtWidgets import QGraphicsOpacityEffect
|
||||
|
||||
class LogoAnimations:
|
||||
def __init__(self, ui):
|
||||
self.ui = ui
|
||||
self.logos = [
|
||||
ui.vol1bg, ui.vol2bg, ui.vol3bg,
|
||||
ui.vol4bg, ui.afterbg
|
||||
]
|
||||
self.animation_group = None
|
||||
|
||||
def initialize(self):
|
||||
"""初始化所有logo的状态(透明且位于屏幕外)"""
|
||||
for logo in self.logos:
|
||||
# 保存原始位置
|
||||
logo.original_pos = logo.pos()
|
||||
# 设置透明度效果
|
||||
opacity_effect = QGraphicsOpacityEffect(logo)
|
||||
logo.setGraphicsEffect(opacity_effect)
|
||||
opacity_effect.setOpacity(0)
|
||||
# 移动到屏幕左侧外
|
||||
logo.move(-logo.width(), logo.y())
|
||||
|
||||
def create_animation_sequence(self):
|
||||
"""创建顺序动画序列"""
|
||||
self.animation_group = QSequentialAnimationGroup()
|
||||
|
||||
# 为每个logo创建动画(延迟递增)
|
||||
delays = [0, 50, 100, 150, 200] # 每个动画的延迟时间(ms)
|
||||
|
||||
for i, logo in enumerate(self.logos):
|
||||
# 创建并行动画组(位置+透明度)
|
||||
parallel_group = QParallelAnimationGroup()
|
||||
|
||||
# 位置动画(从左侧滑入)
|
||||
pos_anim = QPropertyAnimation(logo, b"pos")
|
||||
pos_anim.setDuration(800)
|
||||
pos_anim.setStartValue(QPoint(-logo.width(), logo.y()))
|
||||
pos_anim.setEndValue(logo.original_pos)
|
||||
pos_anim.setEasingCurve(QEasingCurve.OutBack)
|
||||
|
||||
# 透明度动画(淡入)
|
||||
opacity_anim = QPropertyAnimation(logo.graphicsEffect(), b"opacity")
|
||||
opacity_anim.setDuration(800)
|
||||
opacity_anim.setStartValue(0)
|
||||
opacity_anim.setEndValue(1)
|
||||
|
||||
parallel_group.addAnimation(pos_anim)
|
||||
parallel_group.addAnimation(opacity_anim)
|
||||
|
||||
# 添加延迟(使动画按顺序触发)
|
||||
if delays[i] > 0:
|
||||
delay_anim = QPropertyAnimation(logo, b"pos")
|
||||
delay_anim.setDuration(delays[i])
|
||||
self.animation_group.addAnimation(delay_anim)
|
||||
|
||||
self.animation_group.addAnimation(parallel_group)
|
||||
|
||||
return self.animation_group
|
||||
|
||||
def start_animation(self):
|
||||
"""启动动画序列"""
|
||||
self.initialize()
|
||||
self.create_animation_sequence()
|
||||
self.animation_group.start()
|
||||
|
||||
def stop_animation(self):
|
||||
"""停止动画"""
|
||||
if self.animation_group:
|
||||
self.animation_group.stop()
|
||||
99
install.ui
@@ -35,7 +35,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>FRAISEMOE2</string>
|
||||
<string> UI Test</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
@@ -69,7 +69,102 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>IMG/5kXCDK1893.jpeg</pixmap>
|
||||
<pixmap>IMG/BG/bg2.jpg</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="vol1bg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>250</y>
|
||||
<width>93</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>IMG/LOGO/vo01_logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="vol2bg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>310</y>
|
||||
<width>93</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>IMG/LOGO/vo02_logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="vol3bg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>370</y>
|
||||
<width>93</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>IMG/LOGO/vo03_logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="vol4bg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>430</y>
|
||||
<width>93</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>IMG/LOGO/vo04_logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="afterbg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>490</y>
|
||||
<width>93</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>IMG/LOGO/voaf_logo.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
|
||||
20
main.py
@@ -1,12 +1,14 @@
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow ,QPushButton
|
||||
# main.py
|
||||
import sys
|
||||
from PySide6.QtWidgets import QApplication
|
||||
from Ui_install import Ui_MainWindows
|
||||
from main_window import MainWindow
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication()
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
app.exec()
|
||||
sys.exit(app.exec())
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
26
main_window.py
Normal file
@@ -0,0 +1,26 @@
|
||||
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)
|
||||