[PyQt] SIP fails with "syntax error" on simple class inheritance

tuxor1337 at web.de tuxor1337 at web.de
Mon Apr 30 11:27:03 BST 2012


Why does the attached sip-file always fail to be "sipped" with the 
following error message:

sip: my_dialog.sip:15: syntax error

(line 15 is "class MyDialog : public QDialog {")

I tried to use a configure.py or directly call sip command line, but it 
always fails with the same error message.

What am I doing wrong? Is there a tutorial out there that's a bit easier 
to understand than the official documentation 
(http://www.riverbankcomputing.co.uk/static/Docs/sip4/using.html)? The 
documentation is rather useless when using SIP for bigger or more 
complex libraries.

###### Code of my_dialog.sip #######################

%Module myDialog

%Import QtGui/QtGuimod.sip

%If (Qt_4_2_0 -)

namespace ui {

%TypeHeaderCode
#include "my/ui/buttons.h"
#include "my/ui/label.h"
#include "my/ui/soft_shadow.h"
%End

class MyDialog : public QDialog {

public:
     MyDialog(QWidget *parent, bool show_shadow = true);
     ~MyDialog(void);

     void updateTitle(const QString &message);

public Q_SLOTS:
     virtual void done(int);
};

%End

};


More information about the PyQt mailing list