📜  pyqt 加载屏幕 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:23.835000             🧑  作者: Mango

代码示例1
if __name__ == "__main__":
    app = QApplication([])
    # Create splashscreen
    splash_pix = QtGui.QPixmap('icons/Image.png')
    splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
    widget = Main()
    # add fade to splashscreen 
    opaqueness = 0.0
    step = 0.06
    splash.setWindowOpacity(opaqueness)
    splash.show()
    while opaqueness < 1:
        splash.setWindowOpacity(opaqueness)
        time.sleep(step) # Gradually appears
        opaqueness+=step
    time.sleep(1.2)
    splash.close()

    # Run the normal application
    widget.show()
    app.exec_()