[PyQt] QSplashScreen and windows

Darryl Wallace darryl.wallace at prosensus.ca
Wed Jun 18 21:03:43 BST 2008


I fixed it. 

If anyone else gets this and doesn't know.

add the line

qApp.processEvents()

after splash.show()

darryl

Darryl Wallace wrote:
> Has anyone had trouble getting splash screen to display properly in 
> Windows?  I imagine this is a Qt problem and not a PyQt problem but I 
> thought I would ask here as well as Qt support.
>
> I have written a code like this:
> ##########################
> from PyQt4 import QtGui, Qt
>
> import sys
> import os
> from time import sleep
> import resources
>
> progname = "MainWindow"
>
> if __name__ == "__main__":
>    qApp = QtGui.QApplication(sys.argv)
>  
>      splash=QtGui.QSplashScreen(QtGui.QPixmap(
>                ":"+"resources/main_logo.png"),
>                Qt.Qt.WindowStaysOnTopHint)
>    splash.showMessage("Loading %s..."%progname)
>    splash.show()
>      splash.raise_()
>    ####
>    #### Import the main application window
>    ####
>    from mainwindow import MainWindow
>    splash.raise_()
>    aw = MainWindow(progname)
>    splash.raise_()
>    aw.show()
>    splash.raise_()
>    aw.raise_()
>    splash.raise_()
>    splash.raise_()
>    splash.raise_()
>    splash.raise_()
>    splash.raise_()
>    splash.raise_()
>    sleep(1)                  # add a little sleep.  if the mainwindow 
> loads super quickly,
>                                    # splash screen quits on aw and you 
> barely see it
>    splash.finish(aw)
>    aw.raise_()
>    sys.exit(qApp.exec_())
>
> ##########################
>
> as you can see, some frustration has led to repeatedly trying to raise 
> the splash screen to the highest level on the screen.
>
> This code works fine under linux (even without all of the 
> splash.raise_() calls).
>
> Using PyQt4.4.2, Qt 4.4.0, Ubuntu 8.04, and any kind of Windows >= 
> Win2k pro
>
> Any one else have this problem?
>
> Thanks,
> Darryl
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


More information about the PyQt mailing list