By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,171 Members | 809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,171 IT Pros & Developers. It's quick & easy.

sip problem (was: swig problem)

P: n/a
Torsten Marek wrote:
Unless you insist on using swig (in that case, I can't help you), you
might want to try out 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:

class QListViewItemNumeric : QListViewItem {
#include "qlistviewitemnumeric.h"
QListViewItemNumeric( QListView * );
virtual void setNumeric( int );
virtual QString key( int, bool ) const;

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?

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.