[PyKDE] Re: python/qt "slots" clash

Patrick Stinson patrickkidd.lists at gmail.com
Tue Jan 16 19:37:47 GMT 2007


sorry for the late reply - it's deadline time here...

yes - it absolutely does. That is infact exactly what I told my other
developers to do...

On 1/16/07, Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> On Wednesday 10 January 2007 10:55 pm, Patrick Stinson wrote:
> > sorry for the double-post, but FYI adding
> >
> > #undef slots
> >
> > to the top of all of the sip*.cpp makes that file compile just fine.
> > This is not a solution though because those files are auto-generated
> > by sip...
> >
> > On 1/10/07, Patrick Stinson <patrickkidd.lists at gmail.com> wrote:
> > > There is a clash with the "slots" definition in (at least) python2.3
> > > and the qt definition of "slots." Apparently this bug has been fixed
> > > in a later version of python, but I would like to avoid an upgrade at
> > > this point.
> > >
> > > The problem is solvable if you
> > >
> > > #undef slots
> > >
> > > before including any qt headers in your C++ code. I have embedded the
> > > python interpreter into my application, and included a bunch of sip
> > > files to access my data structures from within my C++ executable.
> > >
> > > My problem is that I am using precompiled headers and I include sip.h
> > > then QtCore and QtGui, like this:
> > >
> > > #include <sip.h>
> > > #undef slots
> > > #include <QtGui>
> > > #include <QtCore>
> > >
> > > ...so slots gets redefined by the qt headers. when my sip*.cpp files
> > > are compiled they include sip.h *then* my ModuleHeaderCode, and I get
> > > the clash again. I am confused because sip.h should not be included
> > > twice, so how is the clash comin back if the order is fixed in the
> > > pch?
> > >
> > >
> > > Here is the related python bug report:
> > >
> > > http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fmail.python.o
> > >rg%2Fpipermail%2Fpython-bugs-list%2F2005-September%2F030473.html&ei=gmqlRY
> > >vGHaaygwPmk_j3CQ&usg=__hJynaNrnzniof4fKXQdZHJxA5N4=&sig2=9B34igyhUw06q8BU6
> > >HjrNw
>
> Does putting the #undef slots before the include of Python.h in sip.h also
> work?
>
> Phil
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>


-- 
Patrick Kidd Stinson
http://www.patrickkidd.com/
http://pkaudio.sourceforge.net/
http://pksampler.sourceforge.net/




More information about the PyQt mailing list