[PyQt] Getting %If checks to work in SIP class declarations

Raphael Kubo da Costa rakuco at FreeBSD.org
Sat Aug 2 21:04:53 BST 2014


PyKDE's bindings are having some trouble with SIP 4.16 after it renamed
annotations like PyQt4NoQMetaObject to PyQtNoQMetaObject.

I was trying to check for SIP_4_16 in the sip files and do something
like this:

  %If (SIP_4_16 - )
  class Foo : QObject /NoDefaultCtors,PyQtNoQMetaObject/
  %End
  %If ( - SIP_4_16)
  class Foo : QObject /NoDefaultCtors,PyQt4NoQMetaObject/
  %End
  {
    ...
  }

but sip errors out with a syntax error pointing to the line with the
first %End.

Is there a different way to do this?



More information about the PyQt mailing list