[PyKDE] Passing a type through SIP

James Lamanna jlamanna at gmail.com
Sun Jan 9 21:41:12 GMT 2005


Ok I see what you mean about SIP needing to know the type.

Here's exactly what I'm trying to do:
I've compiled Qt for windows under the GPL license using the work from
the kde-cygwin project.
QWidget::create()'s first argument is of type WId.
This is typedefed in qwindowdefs_win.h as a HWND.
I _believe_ HWND is an unsigned long, but if I typedef WId to this, I
get compile errors saying that i either need a c-style cast or
reinterpret cast to convert the unsigned long to a HWND in all of the
sip generated .cpp files.

I hope this helps you understand the problem better.

Thanks.


On Sun, 9 Jan 2005 12:56:56 -0800, James Lamanna <jlamanna at gmail.com> wrote:
> Is there any way to make SIP include type definitions from a C++ header file?
> This type is defined in a C++ header file, so when the real compiler
> goes to work, it would compile fine.
> (I've tested this by typedefing WindowID as unsigned long, and then
> going back and changing all occurences in the generated C++ code back
> to WindowID and it compiles fine)
> 
> 
> On Sun, 9 Jan 2005 20:20:59 +0000, Phil Thompson
> <phil at riverbankcomputing.co.uk> wrote:
> > On Sunday 09 January 2005 7:45 pm, James Lamanna wrote:
> > > Lets say I have the following in my .sip file:
> > >
> > > class Klass {
> > > ....stuff....
> > > WindowID id;
> > > ....stuff....
> > > };
> > >
> > > SIP wants to know what type WindowID is.
> > > I want to compile this on Windows, where WindowID is actually a HWND.
> > > However putting the following into the sip file does not work:
> > > typedef HWND WindowID;
> > >
> > > beecause SIP complains that it doesn't know about HWND.
> > > Is there any way to have SIP pass this type through unchanged so that
> > > the real compiler deals with it?
> >
> > No, because SIP needs to deal with it as well, and so needs to know the real
> > underlying type.
> >
> > Phil
> >
>




More information about the PyQt mailing list