[PyKDE] Basic sip problem

Phil Thompson phil at riverbankcomputing.co.uk
Sun Jan 18 17:04:01 GMT 2004


On Sunday 18 January 2004 3:55 pm, Jahn Otto Næsgaard Andersen wrote:
> Hello there,
>
> I'm a bit lost when using SIP here. I am using Python 2.3.3, SIP 4.0rc2,
> Qt 3.2.3 and PyQt 3.10.
>
> I have a C++ class, ExaminerWidget, that is inheriting QWidget.
>
> I have made the following sip file examinerwidget.sip (most functions
> are omitted just to test if I can make this basic setup work):
>
> ---------------
> %Module HoloLib
>
>
> %HeaderCode
> #include "examinerwidet.h"
> %End
>
> class ExaminerWidget : QWidget
> {
>   public:
>     ExaminerWidget(QWidget * parent=0, const char * name=0);
> };
>
>
> ------------
>
>
> I have been using the tutorial at
> http://pegasus.rutgers.edu/~elflord/unix/siptute/

Bad idea.

> and PyQt's qbutton.sip
> as examples.

Good idea.

> As far as I understand, the sip tool will generate .h and .cpp files
> that will later be linked together with my HoloLib library (in which the
> examinerwidget resides).
>
> I am getting the following error:
>
> jotto at holodeck(~/work/py_hololib)$ make
> /usr/local/bin/sip -s ".cpp" -c sipcode examinerwidget.sip
> sip: examinerwidget.sip:4: parse error
> make: *** [sip] Error 1
>
>
> Is my sip file faulty?

Try...

%Module HoloLib

%Import qtmod.sip

class ExaminerWidget : QWidget
{
%TypeHeaderCode
#include "examinerwidget.h"
%End

  public:
    ExaminerWidget(QWidget * /TransferThis/ =0, const char * =0);
};

Phil




More information about the PyQt mailing list