Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyqt loading screen

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_()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pyqt #loading #screen
ADD COMMENT
Topic
Name
3+7 =