[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: Re: [PyKDE] problem with event filter?
From:       "Patrick Stinson" <patrickkidd.lists () gmail ! com>
Date:       2006-11-18 2:14:19
Message-ID: 664bf2b80611171814r27a152br244d8227636d067d () mail ! gmail ! com
[Download RAW message or body]

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

On 11/17/06, David Boddie <david@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@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/

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic