[PyKDE] RE: QCustomEvent::QCustomEvent ( Type type, void * data ) constructor no longer supported?

Tuvi, Selim stuvi at slac.stanford.edu
Wed Feb 16 18:39:01 GMT 2005


Thanks, that clears it up. The exception message was misleading.

-Selim

Selim Tuvi, Research Engineering Group, SLAC
GLAST, I&T Online, MS 98
Tel:650-926-3376 Fax:650-926-4335
 

> -----Original Message-----
> From: Phil Thompson [mailto:phil at riverbankcomputing.co.uk]
> Sent: Wednesday, February 16, 2005 1:45 AM
> To: Tuvi, Selim
> Cc: pykde at mats.imk.fraunhofer.de
> Subject: Re: QCustomEvent::QCustomEvent ( Type type, void * data )
> constructor no longer supported?
> 
> > The following code which used to work with PyQt 3.13 does not work with
> > PyQt-commercial-snapshot-20050211:
> >
> > class PorcineEvent(qt.QCustomEvent):
> >     StatusChangeType=qt.QEvent.User+10
> >     CommandingChangeType=qt.QEvent.User+11
> >     def __init__(self,type,data):
> >         qt.QCustomEvent.__init__(self,type,data)
> >
> > Traceback (most recent call last):
> >   File "c:\projects\LATTE\tools\taskEngine.py", line 74, in run
> >     taskArgsKwargs[0](*taskArgsKwargs[1:-1], **taskArgsKwargs[-1])
> >   File "c:\projects\LATTE\power\PorcinePanel.py", line 272, in
> __getStatus
> >
> qt.QApplication.postEvent(self,PorcineEvent(PorcineEvent.StatusChangeType,
> st
> > atus))
> >   File "c:\projects\LATTE\power\PorcinePanel.py", line 400, in __init__
> >     qt.QCustomEvent.__init__(self,type,data)
> > TypeError: too many arguments to QCustomEvent(), 1 at most expected
> 
> In SIP 4.2 enums are implemented as distinct types rather than integers so
> that they nehave the same as they do in C++. After doing the addition, the
> type of the above expression is integer, but it should be Type. Replace it
> with, something like, the following.
> 
>     StatusChangeType = qt.QEvent.Type(qt.QEvent.User + 10)
> 
> The exception message looks wrong - I will check that.
> 
> Phil




More information about the PyQt mailing list