[PySide] can't wrap subclass of QObject?

Matthew Woehlke matthew.woehlke at kitware.com
Mon Jul 22 22:33:27 CEST 2013


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?

-- 
Matthew




More information about the PySide mailing list