sip problem (was: swig problem)

U

Uwe Mayer

Torsten said:
Unless you insist on using swig (in that case, I can't help you), you
might want to try out sip (www.riverbankcomputing.co.uk/sip) to work
with Qt and Python. To find out how to get your (own) Qt classes to work
with Python, you can have a look at the interface files of PyQt, there
are plenty of examples.

I'm not fixed on swig, thats just what I came up with first. If sip holds
what it promises I'd rather use sid, i.e. better Python support.

So I installed it, read the documentation and I'm stuck again. My
specification file does not work. Its really pretty straight forward:

--snip--
class QListViewItemNumeric : QListViewItem {
%TypeHeaderCode
#include "qlistviewitemnumeric.h"
%End
public:
QListViewItemNumeric( QListView * );
virtual void setNumeric( int );
virtual QString key( int, bool ) const;
};
--snip--

Although the C++ files contain more methods; I just wanted to get started
with a small test-version.

I couldn't find a documentation of the %* directives and took what I could
gatherd from the PyQt examples.

So when I call sip:

$ sip qlistviewitemnumeric.sip
sip: qlistviewitemnumeric.sip:1: class definition not allowed in a C module

I even tried this with a default pyqt qtimer.sip file. There sip doesn't
like the "%If (QT_2_0_0 -)" directive.

Any ideas?

Thanks
Uwe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top