[PyQt] SIP generated module crashes on initialization

Иван Андрианов payableondeath90 at gmail.com
Tue Jan 24 08:48:06 GMT 2012


Hello.

I tried to generate bindings for my own library and found something that
looks like a bug in SIP. Here is a small example.

///// testsip.h /////
#ifndef TESTSIP_H
#define TESTSIP_H

#include <QObject>

#ifdef testsip_EXPORTS
  #define TESTSIP_API __declspec(dllexport)
#else
  #define TESTSIP_API __declspec(dllimport)
#endif

class TESTSIP_API TestObject : public QObject
{
    Q_OBJECT

public:
    TestObject() {}
};

class TESTSIP_API TestObject2 : public TestObject
{
    Q_OBJECT

public:
    TestObject2() {}
};

#endif

///// testsip.sip /////
%Module testsip
%Import PyQt4/QtCore/QtCoremod.sip

class TestObject : QObject
{
%TypeHeaderCode
#include <testsip.h>
%End

public:
    TestObject();
};

class TestObject2 : TestObject
{
%TypeHeaderCode
#include <testsip.h>
%End

public:
    TestObject2();
};

'import testsip' gives me a crash. If I comment subclassing from QObject
and add a private copy constructor (to eliminate a compilation error) in
testsip.sip it works fine.

PS: I use sip 4.13.1, PyQt 4.9, Python 3.2, MS VC++ 2008.

Thanks in advance, Ivan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120124/d63bfe89/attachment.html>


More information about the PyQt mailing list