Shiboken 1.1.1 wrapper calling QObject::metaObject rather than Foo::metaObject ?

  • When I run shiboken on a custom QWidget subclass called Foo (see below), it mostly works fine, with one major issue. The FooWrapper::metaObject generated by shiboken does basically the following: first check if the function is overridden in python, and if not, it calls QObject::metaObject. That's surprising; it seems like it should instead call Foo::metaObject. The result is that outside the Foo constructor, I can't access the custom signals and slots.

    I assume I'm doing something wrong because otherwise this is a glaring bug. Any hints?

    Here's my cut-down test case:

    -- foo.h
    [code]#include <QWidget>

    class Foo : public QWidget {
    Foo( QWidget *parent=0 );

    -- global.h
    [code]#undef QT_NO_STL
    #undef QT_NO_STL_WCHAR
    #ifndef NULL
    #define NULL 0
    #include "pyside_global.h"
    #include "foo.h"[/code]

    -- typesystem-foo.xml
    [code]<?xml version="1.0"?>
    <typesystem package="foo">
    <load-typesystem name="typesystem_core.xml" generate="no"/>
    <load-typesystem name="typesystem_gui.xml" generate="no"/>
    <load-typesystem name="typesystem_templates.xml" generate="no"/>
    <object-type name="Foo"/>

    Then I run:
    [code]/usr/local/bin/shiboken global.h --include-paths=/usr/local/include/QtCore:/usr/local/include/QtGui:/usr/local/include:/usr/local/include/PySide:/usr/local/include/PySide/QtCore:/usr/local/include/PySide/QtGui:/usr/local/include/shiboken:/usr/local/share/qt4/mkspecs/default:/usr/include --typesystem-paths=.:/usr/local/share/PySide/typesystems --output-directory=foo typesystem-foo.xml[/code]

    And you can inspect foo/foo/foo_wrapper.cpp at FooWrapper::metaObject, which has the line:
    [code]return this->::QObject::metaObject();[/code]

    [code]perl -pi.bak -e 's/QObject::metaObject/Foo::metaObject/' foo_wrapper.cpp[/code]

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.