Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Shiboken 1.1.1 wrapper calling QObject::metaObject rather than Foo::metaObject ?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 1.5k Views 1 Watching
  • 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 Offline
    H Offline
    hudsonb
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved