Your OpenSource Publisher™
Products  |  Where to buy  |  Retailers  |  FAQ  |  Write for Us.  |  Contact Us.

Boudewijn Rempt

ISBN: 0-97003300-4-4
Available from bookstores everywhere or you can order it here.

You can download the source files for the book (code / eps) here.


How sip works

How sip works

Sip is in fact two things: a program, sip, that can be used to generate C++ wrapper code, and a small runtime library that handles much of the C++ functionality, such as signals and slots.

The program sip takes a set of input files that are created by the developer (.sip files) and uses them to generate a set of .h and .cpp files which are compiled and installed into a C++ library that Python knows how to communicate with.

In most cases, sip generates all C++ code automatically, but in some special cases it is necessary to manually write some wrapper code.

If you have the PyQt source distribution, you'll notice that you have a set of files whose names end with the .sip suffix, and another set of .h/.cpp files whose names begin with sip.

The .h/.cpp C++ files were generated from the .sip files using sip. These C++ files were then compiled to produce libraries that can be installed in the Python site-packages directory. Python can use these files to access the Qt library classes, methods and variables.