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

List:       pykde
Subject:    Re: [PyQt] KIntNumInput question
From:       Jim Bublitz <jbublitz () nwinternet ! com>
Date:       2008-12-21 17:45:02
Message-ID: 200812210945.02612.jbublitz () nwinternet ! com
[Download RAW message or body]

On Sunday 21 December 2008 07:40:25 am Neal Becker wrote:
>         num_in = KIntNumInput (self, 0, 0, 16)
>
> gives:
> TypeError: too many arguments to KIntNumInput(), 1 at most expected
>
> But according to
> http://api.kde.org/pykde-4.1-api/kdeui/KIntNumInput.html#obj175289196
>
> There are constructors taking 1,2, and 3 args.  What am I missing? 
> Is there some other doc I should be looking at?

The docs you linked are a little confusing. If you were calling __init__ 
directly, you'd pass 'self'. But since you're calling the constructor 
instead, the 'self' argument isn't used.

Since KIntNumInput is ultimately a subclass of QWidget, sip appears to 
be choosing the single argument constructor - KIntNumInput (QWidget), 
where the QWidget is 'self', and for that constructor only a single 
argument is passed.

If you drop the 'self' argument, it should work.

Seems like the docs should show you how to put together a constructor 
properly.

Jim
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

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