[PyKDE] problem with event filter?

Patrick Stinson patrickkidd.lists at gmail.com
Sat Nov 18 02:14:19 GMT 2006


ahh yes. I suppose the semantics make more sens that way...

On 11/17/06, David Boddie <david at boddie.org.uk> wrote:
> On Fri, 17 Nov 2006 12:11:55 -0900, Patrick Stinson wrote:
>
> >Does QObject.eventFilter work as it is supposed to? My eventFilter
> >method never gets called, even after typing in the line edit...
> >
> >class SpinBox(QSpinBox):
> >    def __init__(self, parent=None):
> >        QSpinBox.__init__(self, parent)
> >        self.installEventFilter(self.lineEdit())
> >
> >    def eventFilter(self, o, e):
> >        print o, e
> >        if o == self.lineEdit():
> >            print e.isDoubleClick()
>
> You've got it the wrong way round: you set the event filter on the object
> you want to watch:
>
>   http://doc.trolltech.com/4.2/qobject#installEventFilter
>
> It's a common mistake. I have to look it up every time I use it, just to
> make sure. :-)
>
> David
>
>
> ___________________________________________________________
> $0 Web Hosting with up to 200MB web space, 1000 MB Transfer
> 10 Personalized POP and Web E-mail Accounts, and much more.
> Signup at www.doteasy.com
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>


-- 
Patrick Kidd Stinson
http://www.patrickkidd.com/
http://pkaudio.sourceforge.net/
http://pksampler.sourceforge.net/




More information about the PyQt mailing list