[PyQt] Re: SplashScreen and mousePressEvent

projetmbc projetmbc at club-internet.fr
Wed Apr 8 13:16:31 BST 2009


projetmbc a écrit :
> Hello,
> I would like to close a splashscreen if the user clicks on it. I 
> decide to subclass QtGui.QSplashScreen to do that but the following 
> code doesn't catch the mouse press event. Why ?
>
> Best regards.
> Christophe
>
> ======
> The code
> ======
>
> class mySplashScreen(QtGui.QSplashScreen):
>    def __init__(self, pixmap):
>        super(QtGui.QSplashScreen, self).__init__(pixmap)
>          def mousePressEvent(self, event):
>        print 'ok'
>

The right indentation of the code is the following one :
class mySplashScreen(QtGui.QSplashScreen):
   def __init__(self, pixmap):
       super(QtGui.QSplashScreen, self).__init__(pixmap)
   def mousePressEvent(self, event):
      print 'ok'



More information about the PyQt mailing list