[PyQt] SIP: newbie question 3

Johan Råde johan.rade at gmail.com
Fri Jul 8 10:49:23 BST 2011


On 2011-07-08 11:06, Jens Thoms Toerring wrote:

> Another point that may interfere: do you run SIP with the '-e'
> option?

Thank you Jens.
That solved the problem.
(It seems a bit old-fashioned that support for exceptions is not enabled 
by default, but since Qt does not use exceptions it is perhaps natural.)

A minor annoyance: The function translate in

%Exception std::exception /Default/
{
%RaiseCode
      SIP_BLOCK_THREADS
      translate(sipExceptionRef);
      SIP_UNBLOCK_THREADS
%End
};

is defined in "../../TextTable/Exceptions.h".
To handle that I have to add
#include "../../TextTable/Exceptions.h"
to the %TypeHeaderCode block in each class in the sip file.
Adding it to a %TypeHeaderCode block in the %Exception directive has no 
effect.



More information about the PyQt mailing list