[PyKDE] how to use sip?

Phil Thompson phil at riverbankcomputing.co.uk
Mon Feb 16 22:16:01 GMT 2004


On Monday 16 February 2004 18:34, Uwe Mayer wrote:
> Hi,
>
> sorry for this newbe question, but I just don't get sip running. I've read
> the documentation and it doesn't say anything on how the structure of the
> specification file.
>
> I downloaded, compiled and installed the newes version of sip: 4.0 RC2, but
> sip even returns an error when I feed it any of the current PyQt .sid
> files...:
>
> $ sip qtimer.sip
> sip: qtimer.sip:32: class definition not allowed in a C module
>
> All I wanted was to derive from QListViewItem and overwrite the key()
> method. The C++ implementation is ready and compiles, just the Python
> binding is missing.
>
> Currently I got the files
> qlistviewitemnumeric.cpp
> qlistviewitemnumeric.sip
> qlistviewitemnumeric.h
>
> -- qlistviewitemnumeric.sip --
> %Module QListViewItemNumeric
>
> class QListViewItemNumeric :QListViewItem {
> %TypeHeaderCode
> #include <qlistview.h>
> %End
>
> public:
>   QListViewItemNumeric( QListView * );
>
>   virtual void setNumeric( int );
>   virtual QString key( int, bool ) const;
> };
> -- end --
>
> and calling sip yields:
>
> $ sip qlistviewitemnumeric.sip
> sip: QListViewItem has not been defined
>
> and does nothing.
>
>
> Perhaps someone can give me some pointers.

Get the current SIP v4 snapshot. It has more documentation, including some 
worked examples including the use of %Import.

Phil




More information about the PyQt mailing list