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

On 11/17/06, David Boddie <[EMAIL PROTECTED]> 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    [email protected]
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    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to