[PyKDE] Basic SIP question

Smith, Dave dave.smith at transcendata.com
Fri May 3 09:31:00 BST 2002


Bjorn,

The best documentation for SIP that I know of is in Appendix C
(written by Jim Bublitz) in Boudewijn Rempt's PyQt book (available
at http://www.opendocs.org/pyqt/).

When creating the .sip file from a .h file, one of the steps should
be to remove all parameter names, i.e.
   void setVar (int v);
becomes
   void setVar (int);
this should resolve your parse error.

I ran into the issue of sip not generating any output while
trying to figure SIP out a week or so ago.  I discovered that
you MUST specify the -c <dir> command line option to sip in
order to make sip generate any output.  For my test case, which
derived from QWidget, I used the sip command:
   mkdir sip
   sip -c sip -I %PYQTDIR%\sip -t Qt_3_0_2 -t WS_WIN qtestmod.sip

Dave

-----Original Message-----
From: Bjorn Pettersen [mailto:BPettersen at narex.com]
Sent: Thursday, May 02, 2002 6:24 PM
To: PyKDE at mats.gmd.de
Subject: [PyKDE] Basic SIP question


I'm a complete newbie to SIP, so please feel free to direct me to any
FAQs, documents etc. that I have missed.

I'm trying to wrap a very basic class:

  class Foo {
    int var;
  public:
    void setVar(int v);
    int getVar();
  };

with the following .sip file

  class Foo {
  %HeaderCode
  #include "Test.h"
  %End
  public:
    int getVar();
    void setVar(int v);
  };

and SIP is giving me a parse error on the void setVar() line. If I
remove the "int v" argument SIP runs, but doesn't create any output
files...

What am I doing wrong?

-- bjorn

_______________________________________________
PyKDE mailing list    PyKDE at mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde




More information about the PyQt mailing list