27 Star 46 Fork 19

PESCMS / PESCMS Login GUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
loading.py 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
PESCMS 提交于 2015-08-22 13:10 . 添加异常和加载条
import sys, time
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class MovieSplashScreen(QSplashScreen):
def __init__(self, movie, parent = None):
movie.jumpToFrame(0)
pixmap = QPixmap(movie.frameRect().size())
QSplashScreen.__init__(self, pixmap)
self.movie = movie
self.movie.frameChanged.connect(self.repaint)
def showEvent(self, event):
self.movie.start()
def hideEvent(self, event):
self.movie.stop()
def paintEvent(self, event):
painter = QPainter(self)
pixmap = self.movie.currentPixmap()
self.setMask(pixmap.mask())
painter.drawPixmap(0, 0, pixmap)
def sizeHint(self):
return self.movie.scaledSize()
if __name__ == "__main__":
app = QApplication(sys.argv)
movie = QMovie("ajax-loader.gif")
splash = MovieSplashScreen(movie)
splash.show()
# start = time.time()
#
# while movie.state() == QMovie.Running and time.time() < start + 10:
# app.processEvents()
# window = QWidget()
# window.show()
# splash.finish(window)
sys.exit(app.exec_())
Python
1
https://gitee.com/fallBirds/PESCMS-Login-GUI.git
git@gitee.com:fallBirds/PESCMS-Login-GUI.git
fallBirds
PESCMS-Login-GUI
PESCMS Login GUI
master

搜索帮助