[PyKDE] Problem with dialogues
Tom Chance
tomchance at gmx.net
Sat Mar 29 17:23:01 GMT 2003
On Saturday 29 March 2003 4:01 pm, Phil Thompson wrote:
> On Saturday 29 March 2003 3:37 pm, Tom Chance wrote:
> > Hullo,
> >
> > I've been rewriting an app of mine, and I've run into trouble with
> > opening dialogues. Previously I made a full new class for a dialogue, and
> > then created a class instance within the main window class, and then put
> > all the functions for the dialogue into it's own class.
> >
> > Now I'm trying to avoid having a whole new class for the dialogue, simply
> > working with it from within the main window class. So I've got something
> > like this:
> >
> > class MainWindow(inheriting a Qtdesigner-made class):
> > blah-blah
> > def int_startRipping(self):
> > self.Dialogue = progressDialogue() <--- another Qtdesigner-made class
> > self.Dialogue.__init__(None, None, 0, 0)
> > blah blah
> >
> > But this gives the following error:
> >
> > Traceback (most recent call last):
> > File "./dvd.py", line 140, in ripDVD
> > self.int_startRipping()
> > File "./gui.py", line 130, in int_startRipping
> > self.Dialogue.__init__(None, None, 0, 0)
> > File "guiprogressdialogue.py", line 14, in __init__
> > QDialog.__init__(self,parent,name,modal,fl)
> > File "/usr/lib/python2.2/site-packages/qt.py", line 69, in __init__
> > libqtc.sipCallCtor(199,self,args)
> > TypeError: Cannot sub-class from more than one wrapped class
> > Segmentation fault
> >
> > What does this mean? I'm guessing something to do with class inheritance,
> > but I can't figure it out, so any attempts to fix it are just stabs in
> > the dark. I'd prefer to keep the code structure as it is, without another
> > class, but is this possible?
>
> Why are you explicitly calling progressDialog's __init__()?
Ahhh, now I feel silly. It was because previously I was using a seperate class
for the dialogue, and so had to provide an __init__() function in that class,
which in turn had to call the __init__() for progressDialog. Of course now
that it's not a seperate class, that's completely unecessary!
Thanks :)
Tom
More information about the PyQt
mailing list