[PyKDE] Speeing up source file creation when using SIP with PyQt/PyKDE

Jim Bublitz jbublitz at nwinternet.com
Tue Feb 20 16:29:05 GMT 2007


On Tuesday 20 February 2007 06:28, Paul Giannaros wrote:
> I'm creating bindings for a module in KDE (not included in PyKDE). While
> things work fine, running sip on the .sip file takes a long time on my
> machine -- ~15 seconds. It looks like it's processing all of the Qt/KDE sip
> stuff each time. I don't fully understand the sip system, but is there a
> way I can stop it doing so, and just process my single one? None of the
> arguments to `sip` look promising, neither does a quick search of the
> documentation help.


You're right - it is processing all of the Qt and KDE stuff that you import. 
For example, if you have classes (which you almost certainly do) that 
subclass QObject or QWidget, their header/sip files contain only the 
information about the methods that the  class's new methods or the inherited 
methods that it overloads.

However, when you use the new class, you expect to be able to access any 
method inherited from QObject or QWidget, so sip has to generate bindings 
(within the new class) for all of those methods as well, and to do that, it 
needs to know what those methods are - exactly the same as gcc/g++ needing to 
see qobject.h, etc.

Jim




More information about the PyQt mailing list