[PyQt] Splash screen under linux

Hugo Léveillé hugol at fastmail.net
Thu Mar 17 18:30:02 GMT 2011


I have a problem displaying a splash screen under linux. The code above
works perfecly under windows from either a IDE or a command line. But
under linux, the code above will display the splash screen perfecly when
it is run from the IDE (netbeans). But when it is lunched from a shell,
it does not display any splash screen but the app start after

Is there something special needed when lauched from a shell??



\
import sys,time
from PyQt4 import QtCore , QtGui

from ui.MainWindow import MainWindow

def main():

	app = QtGui.QApplication(sys.argv)
	app.setStyle(QtGui.QStyleFactory.create("plastique"))
	
	
	splash_pix = QtGui.QPixmap('splash.png')
	splash = QtGui.QSplashScreen(splash_pix,
	QtCore.Qt.WindowStaysOnTopHint)
	splash.setMask(splash_pix.mask())
	splash.show()
	app.processEvents()


	time.sleep(2)

	
	mw = MainWindow()
	splash.finish(mw)

	mw.show()

	app.exec_()

if __name__ == '__main__':
    main()
 


-- 
  Hugo Léveillé
  TD Compositing, Vision Globale
  hugol at fastmail.net



More information about the PyQt mailing list