Shiboken Wizard Help

Description

Shiboken Wizard generates a typesystem XML file and a CMake file from a C++ library for generating Python bindings using the Shiboken bindings generator.

Usage

The process is:

Specify the project parameters

Name Name for the bindings to be generated (Python module).
Output directory The directory where to place the generated typesystem and CMake files.
Library The C++ library (shared object or static library) for which to create bindings.
Headers The headers containing the classes for which to create bindings. There are two approaches:
  • Specify all desired class headers.
  • Create an include file containing #include directives for all desired class headers. In that case, uncheck the Use global headers option to prevent that header from being used in generated code.

Scan the headers for classes

When choosing Scan for Classes, the code parser scans the headers and displays the detected classes in the list on the right. For non-trivial cases, this will typically fail at first due to missing include paths. Those can be added in the bottom-left panel until parsing succeeds and a list of classes is displayed.

Choose classes for which to create bindings

Tick the desired classes in the list on the right.

Generate the typesystem XML and CMake file

Use Generate (bottom/right) to create the typesystem XML file and a CMakeLists.txt file into the previously specified output directory.

Build the bindings

After generating the files, the UI switches to the Build tab opens, which let's you edit the files and re-run the build, showing the log files informing about rejected members.

Notes

It is recommend to use the wizard with Qt Creator, particularly for building the bindings. It will then use the IDE as an editor and its build issues pane to display build errors.

To set this up, open the Options dialog, check the group box and specify a path to the Qt Creator executable.