[PySide] can't wrap subclass of QObject?

Matthew Woehlke matthew.woehlke at kitware.com
Mon Jul 22 23:15:13 CEST 2013


On 2013-07-22 16:33, Matthew Woehlke wrote:
> I feel confident I am doing something dumb, but I can't figure out why,
> when trying to wrap any class that subclasses QObject (and/or has a
> Q_OBJECT?), I am getting this error:
>
> foo_wrapper.cpp: error: no ‘const QMetaObject* fooWrapper::metaObject()
> const’ member function declared in class ‘fooWrapper’
>
> Most of the results trying to search the web for similar errors suggest
> an include path issue, however AFAICT I am passing the include
> directories for Qt to shiboken. My command line is (with some unrelated
> includes elided):
>
> /usr/bin/shiboken
>    --generatorSet=shiboken
>    --enable-parent-ctor-heuristic
>    --enable-return-value-heuristic
>    --enable-pyside-extensions /path/to/foo/build/foo/foo_all_sdk_headers.h
>
> --include-paths=/usr/include:[...elided....]:/usr/include:/usr/include/QtGui:/usr/include/QtXml:/usr/include/QtNetwork:/usr/include/QtCore:/path/to/foo/build:/path/to/foo/build/foo
>    --typesystem-paths=/usr/share/PySide/typesystems
>    --output-directory=/path/to/foo/build/foo
>    /path/to/foo/build/foo/foo_typesystem.xml
>
>
> ...and my (simplified) typesystem XML:
>
> <?xml version="1.0"?>
> <typesystem package="fooPython">
>     <load-typesystem name="typesystem_core.xml" generate="no"/>
>     <object-type name="foo"/>
> </typesystem>
>
>
> Any hints?

Possible lead... I am also seeing these warnings:
   type 'QMetaObject' is specified in typesystem, but not defined. This 
could potentially lead to compilation errors.
         signature 'metaObject()const' for function modification in 
'QObject' not found. Possible candidates:

...and lots of others, but those look most relevant.

-- 
Matthew




More information about the PySide mailing list