美文网首页
PyQt5启动画面——等待程序启动不用干瞪眼

PyQt5启动画面——等待程序启动不用干瞪眼

作者: Hemmelfort | 来源:发表于2018-09-08 09:34 被阅读17次

PyQt的启动画面可以通过QSplashScreen类来快捷制作,支持透明图片

import sys
from PyQt5 import QtWidgets, QtGui

# 对Qt部件的操作一般都要在创建Qt程序后才能进行
app = QtWidgets.QApplication(sys.argv)  

# 创建启动界面,支持png透明图片
splash = QtWidgets.QSplashScreen(QtGui.QPixmap('splash.png'))
splash.show()

# 可以显示启动信息
splash.showMessage('正在加载……')

# 关闭启动画面
splash.close() 

相关文章

网友评论

      本文标题:PyQt5启动画面——等待程序启动不用干瞪眼

      本文链接:https://www.haomeiwen.com/subject/audkgftx.html