[PyKDE] enum arguments in sip

Patrick Stinson ajole-1 at gci.net
Wed Sep 10 09:33:01 BST 2003


I've been using sip to generate python bindings for my lib, but ran into a 
problem with passing an enum to a member method.

sip file:
----------------------
public:

  enum ModuleType
  {
    Module,
    Producer,
    Consumer
  };

  static void AddModule(PK_Module *, ModuleType);

header file:
------------------------
public:

  enum ModuleType
  {
    Module,
    Producer,
    Consumer
  };

  PK();

python code:
-------------------------
PK.AddModule(po, PK.Producer)

python exception:
-------------------------

Traceback (most recent call last):
  File "test.py", line 18, in ?
    t.slotLoad("/home/ajole/track.wav")
  File "/usr/home/ajole/src/pksampler/pksampler/Track.py", line 514, in 
slotLoad
    PK.AddModule(po, PK.Producer)
TypeError: Argument 1 of PK.AddModule() has an invalid type




More information about the PyQt mailing list