Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Category:LanguageBindings::PySide::Shiboken::PySide Binding Generation Tutorial: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=PySide Binding Generation Tutorial=
h1. PySide Binding Generation Tutorial


This tutorial describes the process of creating bindings with Shiboken. A very simple Qt-based library will be used as an example.
This tutorial describes the process of creating bindings with Shiboken. A very simple Qt-based library will be used as an example.
Line 5: Line 5:
The image below shows the inputs needed to generate the binding source code.
The image below shows the inputs needed to generate the binding source code.


[[Image:generatorworkings.png]]
[[Image:http://www.pyside.org/docs/shiboken-0.5.0/_images/generatorworkings.png|http://www.pyside.org/docs/shiboken-0.5.0/_images/generatorworkings.png]]


The user provides the headers for the library along with a type system file describing how the classes will be exported to the target language, as well as any needed custom source code to be merged with the generated source code. If no big alteration is needed this will just be a declarative list of classes, namespaces, enums and global functions.
The user provides the headers for the library along with a type system file describing how the classes will be exported to the target language, as well as any needed custom source code to be merged with the generated source code. If no big alteration is needed this will just be a declarative list of classes, namespaces, enums and global functions.


This tutorial will go through the steps needed to have the binding ready to be imported and used from a Python program. The tutorial source code is available as a [http://pyside.org/files/binding-tutorial.tar.gz tarball] ''[pyside.org]''. There are two versions of the binding example: the source code is the same but one uses a general Makefile and the other CMake build files; the latter is the system used by Shiboken and PySide.
This tutorial will go through the steps needed to have the binding ready to be imported and used from a Python program. The tutorial source code is available as a "tarball":http://pyside.org/files/binding-tutorial.tar.gz. There are two versions of the binding example: the source code is the same but one uses a general Makefile and the other CMake build files; the latter is the system used by Shiboken and PySide.


'''<span class="caps">ATTENTION</span>:''' this tutorial and example will work with Shiboken and PySide 0.5+.
'''ATTENTION:''' this tutorial and example will work with Shiboken and PySide 0.5+.


* [[PySide Binding Generation Tutorial: Module 1 Creating the foo library|Creating the foo library]]<br /> ([http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LIII French] ''[qt-devnet.developpez.com]'')
* [[PySide_Binding_Generation_Tutorial:_Module_1_Creating_the_foo_library|Creating the foo library]]<br />(&quot;French&amp;quot;:http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LIII)
* [[PySide Binding Generation Tutorial: Module 2 Binding libfoo using Shiboken|Binding libfoo using Shiboken]]<br /> ([http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LIV French] ''[qt-devnet.developpez.com]'')
* [[PySide_Binding_Generation_Tutorial:_Module_2_Binding_libfoo_using_Shiboken|Binding libfoo using Shiboken]]<br />(&quot;French&amp;quot;:http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LIV)
* [[PySide Binding Generation Tutorial: Module 3 Creating Type System Description|Creating the Type System Description]]<br /> ([http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LV French] ''[qt-devnet.developpez.com]'')
* [[PySide_Binding_Generation_Tutorial:_Module_3_Creating_Type_System_Description|Creating the Type System Description]]<br />(&quot;French&amp;quot;:http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LV)
* [[PySide Binding Generation Tutorial: Module 4 The Global Header|The Global Header]]<br /> ([http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LVI French] ''[qt-devnet.developpez.com]'')
* [[PySide_Binding_Generation_Tutorial:_Module_4_The_Global_Header|The Global Header]]<br />(&quot;French&amp;quot;:http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LVI)
* [[PySide Binding Generation Tutorial: Module 5 Building the generator|Building the Generator]]<br /> ([http://qt-devnet.developpez.com/tutoriels/python/pyside/binding-shiboken/#LVII French] ''[qt-devnet.developpez.com]'')
* [[PySide_Binding_Generation_Tutorial:_Module_5_Building_the_generator|Building the Generator]]
 
===There are 5 articles in "LanguageBindings -&gt; PySide -&gt; Shiboken -&gt; PySide_Binding_Generation_Tutorial":===
 
===P===
* [[PySide Binding Generation Tutorial|PySide_Binding_Generation_Tutorial]]
* [[PySide Binding Generation Tutorial: Module 1 Creating the foo library|PySide_Binding_Generation_Tutorial:_Module_1_Creating_the_foo_library]]
* [[PySide Binding Generation Tutorial: Module 2 Binding libfoo using Shiboken|PySide_Binding_Generation_Tutorial:_Module_2_Binding_libfoo_using_Shiboken]]
* [[PySide Binding Generation Tutorial: Module 4 The Global Header|PySide_Binding_Generation_Tutorial:_Module_4_The_Global_Header]]
* [[PySide Binding Generation Tutorial: Module 5 Building the generator|PySide_Binding_Generation_Tutorial:_Module_5_Building_the_generator]]

Revision as of 09:37, 24 February 2015

h1. PySide Binding Generation Tutorial

This tutorial describes the process of creating bindings with Shiboken. A very simple Qt-based library will be used as an example.

The image below shows the inputs needed to generate the binding source code.

http://www.pyside.org/docs/shiboken-0.5.0/_images/generatorworkings.png

The user provides the headers for the library along with a type system file describing how the classes will be exported to the target language, as well as any needed custom source code to be merged with the generated source code. If no big alteration is needed this will just be a declarative list of classes, namespaces, enums and global functions.

This tutorial will go through the steps needed to have the binding ready to be imported and used from a Python program. The tutorial source code is available as a "tarball&quot;:http://pyside.org/files/binding-tutorial.tar.gz. There are two versions of the binding example: the source code is the same but one uses a general Makefile and the other CMake build files; the latter is the system used by Shiboken and PySide.

ATTENTION: this tutorial and example will work with Shiboken and PySide 0.5+.

This category currently contains no pages or media.