[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] Typecasting problems with PyQt embedded in Scribus
From: "Giovanni Bajo" <rasky () develer ! com>
Date: 2005-06-30 22:11:50
Message-ID: 00e001c57dc0$b6a88f20$d9422597 () bagio
[Download RAW message or body]
Jim Bublitz <jbublitz@nwinternet.com> wrote:
>> But I wonder why the following does not work:
>> ptr = sip.unwrapinstance(qt.qApp.mainWidget())
>> mainWindow = sip.wrapinstance(ptr, qt.QMainWindow)
>> Unfortunately mainWindow is still a QWidget.
>
> I'm not sure - my guess is that it's because ptr is already typed in
> Python as a QWidget. I've done something similar to get a C++ object
> into Python, but the object was already the correct type - just
> instantiating the wrapper, but no cast involved.
>
> You might try:
>
> mainWindow = sip.cast (ptr, qt.QMainWindow)
We just discussed this on the list. Phil is going to implement a general
solution so that you always get the most derived class Python knows about --
QMainWindow in this case.
Giovanni Bajo
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic