<HTML>
<HEAD>
<TITLE>Re: [PyQt] SplashScreen and mousePressEvent</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>First, get rid of the mousePressEvent since the Splashscreen closes by default when the user clicks on it. Also, make sure you start the event loop otherwise qt can’t detect mouse events. (Note the following code won’t stop the application, you may need to kill it afterwards)<BR>
<BR>
from PyQt4 import QtGui<BR>
import sys<BR>
app = QtGui.QApplication(sys.argv)<BR>
pixmap = QtGui.QPixmap("splash.png")<BR>
splash = QtGui.QSplashScreen(pixmap)<BR>
splash.show()<BR>
app.exec_()<BR>
<BR>
<BR>
On 4/8/09 7:56 AM, "projetmbc" <<a href="projetmbc@club-internet.fr">projetmbc@club-internet.fr</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
I would like to close a splashscreen if the user clicks on it. I decide<BR>
to subclass QtGui.QSplashScreen to do that but the following code<BR>
doesn't catch the mouse press event. Why ?<BR>
<BR>
Best regards.<BR>
Christophe<BR>
<BR>
======<BR>
The code<BR>
======<BR>
<BR>
class mySplashScreen(QtGui.QSplashScreen):<BR>
def __init__(self, pixmap):<BR>
super(QtGui.QSplashScreen, self).__init__(pixmap)<BR>
<BR>
def mousePressEvent(self, event):<BR>
print 'ok'<BR>
<BR>
_______________________________________________<BR>
PyQt mailing list <a href="PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><BR>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>