[PyKDE] qApp is a QApplication instance
Phil Thompson
phil at riverbankcomputing.co.uk
Mon Mar 21 16:59:29 GMT 2005
> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
>
>>>> No it isn't - sip.cast()
>>>
>>> What would the correct syntax would be, then?
>>>
>>> def pyApp():
>>> import sip
>>> return sip.cast(qApp, App)
>>>
>>> gives me a:
>>>
>>> SystemError: error return without exception set
>>
>> That's the correct syntax. I assume that you have called the App ctor by
>> the time you call pyApp(). If so, can you put together a small, complete
>> example?
>
> Well, it doesn't even pass the basic sanity check:
>
>>>> from qt import *
>>>> class App(QApplication):
> ... pass
> ...
>>>> a = App([])
>>>> qApp
> <qt.QApplication object at 0x0080DCF0>
>>>> import sip
>>>> sip.cast(qApp, App)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> SystemError: error return without exception set
>
> I speculate this got broken when you touched exception support in sip 4.2?
You haven't called QApplication.__init__().
Phil
More information about the PyQt
mailing list