Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    Language Bindings
    1
    1
    1370
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hudsonb last edited by

      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 {
      Q_OBJECT
      public:
      Foo( QWidget *parent=0 );
      };[/code]

      -- global.h
      [code]#undef QT_NO_STL
      #undef QT_NO_STL_WCHAR
      #ifndef NULL
      #define NULL 0
      #endif
      #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"/>
      </typesystem>[/code]

      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]

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

      1 Reply Last reply Reply Quote 0
      • First post
        Last post