[PyKDE] Passing C++-created QWidgets to embedded Python

ian reinhart geiser geiseri at yahoo.com
Tue Apr 16 16:27:59 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 16 April 2002 10:16 am, Robin Summerhill wrote:
> Ian,
>
> I just did a find and replace of SIP_EXPORT to SIP_EXTERN in all the PyQT
> headers. Make sure you define SIP_USE_DLL in the client. If you need to
> rebuild libqtc later, you will need to change SIP_EXTERN back to
> SIP_EXPORT.
>
> Robin
>
Hrm, I am digging through the headers now, Phil, can we make a PY_MAKE_DLL 
flag that will swap SIP_EXPORT to SIP_EXTERN for a more automated build?

So to build Python bindings based off of PyQt we can do a:
	-DSIP_USE_DLL -DPY_MAKE_DLL 
To cause everything to export correctly?

Robin if I understand you correctly you did not rebuild PyQt after you made 
the changes to the header files?

I am not an expert at building windows DLLs so I am looking for the most 
automated solution as possible.

Thanks
- -ian reinhart geiser

> -----Original Message-----
> From: ian reinhart geiser [mailto:geiseri at yahoo.com]
> Sent: 16 April 2002 12:31
> To: Robin Summerhill; 'Phil Thompson'; pykde at mats.gmd.de
> Subject: Re: [PyKDE] Passing C++-created QWidgets to embedded Python
>
>
> Cool this explanes why I get all of these funky crashes.  I guess no-one
> ever
> assumed PyQt would every be crossplaform :\
>
> Robin could you please send me a diff of your changes or the pyqt headers
> you
> used.  I unfortunately cannot wait for the next PyQt release to fix all of
> these windows bugs.
>
> I wonder if we cannot make a PYQT_EXPORT and PYQT_IMPORT?  I am not sure
> how
>
> we can get these autogenerated on the fly though.  Any thoughts on this
> Phil?
>
> -ian reinhart geiser
>
> On Tuesday 16 April 2002 04:00 am, Robin Summerhill wrote:
> > I finally worked out what was going wrong here.
> >
> >
> > It's to do with the requirement to mark declarations with
> > __declspec(DLLEXPORT) or _declspec(DLLIMPORT)to get DLL linking working
> > properly with MSVC.
> >
> >
> > SIP_EXTERN is declared in sip.h and ends up as SIP_EXPORT or SIP_IMPORT
> > according to whether the preprocessor symbols SIP_MAKE_DLL or SIP_USE_DLL
> > are defined. Sip.exe uses this declaration to enable sip-generated
> > headers to be used both in building the dll (EXPORT) and the client of
> > the dll (IMPORT). However, the sip-generated headers that are included in
> > the PyQT distribution have been edited to change SIP_EXTERN to
> > SIP_EXPORT, meaning that these headers can only be used to build the
> > libqtc dll, *not* consume it.
> >
> >
> > There is no clean way around this with the present setup, because
> > SIP_EXTERN is used in the SIP headers too. You can't just change
>
> SIP_EXPORT
>
> > back to SIP_EXTERN because that prevents you from building libqtc.
> >
> >
> > As a temporary measure, I'm keeping two sets of the libqtc headers - one
>
> to
>
> > build libqtc (with SIP_EXORT) and one to include in the client (with
> > SIP_EXTERN and SIP_USE_DLL defined)
> >
> >
> > Having done this (and recompiling everything with -MD to solve my other
> > problems) I can now embed PyQT and it's just *fantastic*
> >
> >
> > Robin Summerhill
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.gmd.de
> http://mats.gmd.de/mailman/listinfo/pykde
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8vDTnPy62TRm8dvgRAgjdAJ0YnoCDThpZziOwwDL/4zlJKE6LFACgrb8c
2+yp2Mf8OHR4+eqBDtK175Q=
=LQDw
-----END PGP SIGNATURE-----


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





More information about the PyQt mailing list