From pykde Mon Dec 22 00:39:00 2008 From: Jim Bublitz Date: Mon, 22 Dec 2008 00:39:00 +0000 To: pykde Subject: Re: [PyQt] Re: KIntNumInput question Message-Id: <200812211639.01027.jbublitz () nwinternet ! com> X-MARC-Message: https://marc.info/?l=pykde&m=122990741822583 On Sunday 21 December 2008 14:22:03 pm Neal Becker wrote: > Jim Bublitz wrote: > > 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#obj175289 > >>196 > >> > >> 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 > > num_in = KIntNumInput (0, 0, 16) > TypeError: argument 2 of KIntNumInput() has an invalid type Can't help you there - I don't have PyKDE4 installed. A short example program would help someone else test it. The only thing I'd suggest is to try passing 'None' for the 2nd (QWidget) argument. Jim _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt