PySide Shiboken Tutorial: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(No difference)
|
Revision as of 16:25, 14 January 2015
Simple Shiboken Binding Tutorial
This is sample demonstration how to generate simple bindings with shiboken python binding generator. This tutorial was written by Roman Lacko in a recent mailing list [lists.qt.io].
- FooLib project contains the library for which we want to generate the bindings
- FooLibBinding project contains the generated binding sources
Software used:
- Qt 4.8.4 MSVC 2010 64bit [releases.qt.io]
- Please note that by default Python 2.7 is built with msvc2008 and Python 3.3 with msvc2010. So in general you should use MSVC2008 to compile, however others have successfully completed this tutorial using MSVC2010.
- Python 2.7 64bit [python.org]
- PySide 1.1.2 for Python 2.7 64bit [releases.qt.io]
- BindingTest.zip [docs.google.com]
Notes:
- Update the paths to python libs and includes in FooLibBinding\FooLibBinding.pro. In this tutorial, it’s assumed that python is installed in C:\Python27_64.
- Also update the path where you have installed Qt on your system in the files below
- Replace this “c:\Qt\qt-4.8.4-msvc2010-x64” with your path
- Note that if you decide to experiment with using mingw, you will need to change the .lib extension to .a
To generate and test the bindings do the following:
- Install PySide
- Copy content of C:\Python27\Lib\site-packages\PySide to BindingTest\PySide folder
- Compile FooLib project
- Run FooLib\generate_binding.bat
- Compile FooLibBinding project
- Run FooLibBinding\make_package.bat
- Go to generated folder “package” and run foolib_test.py