Re: [PySide] Shiboken in python -- was PySide - Qt5 - Swig

2013-01-15 Thread Lucas Tanure
Can we use http://code.google.com/p/pybindgen/ ?


Lucas A. Tanure Alves
+55 (19) 88176559
___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] PySide - Qt5 - Swig

2013-01-15 Thread Lucas Tanure
Can we use http://code.google.com/p/pybindgen/ ?

Lucas A. Tanure Alves
+55 (19) 88176559
___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] PySide - Qt5 - Swig

2013-01-15 Thread John Ehresman
On 1/15/13 2:25 AM, ZHONG Zhu wrote:
 It's a pain when I started to work on a Shiboken binding to move my project 
 to Python based. I've been trying to do a binding with Shiboken on Windows 
 for months but can't make it work. I believe Shiboken is working or people 
 can't build the PySide Windows installer for us. But I just don't have any 
 working tutorial to guide me to bind my Qt C++ library on Windows.
 
 So instead of discussing about rewrite a new binding tool, why not try to 
 document more to show people how Shiboken works?

I agree that we should work with what we have, improving and documenting
it as we work with it.  How far did you get when you tried generating
bindings for your code?  Did you see the
http://lynxline.com/superhybrids-part-2-now-qt-pyside/ blog post or the
example that niki.spah...@gmail.com mentioned?

Please let people know of what problems you do run into; we can probably
help to get things working.

Thanks,

John


___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

2013-01-15 Thread Roman Lacko
btw, you need to update paths to python libs and includes in
FooLibBinding\FooLibBinding.pro. I have installed python in c:\Python27_64.
Also if you are using mingw, you will need to change the .lib extension to
.a

INCLUDEPATH += ../pyside/include/PySide \
../pyside/include/PySide/QtCore \
../pyside/include/shiboken \
c:/Python27_64/include \
../FooLib

LIBS += c:/Python27_64/libs/python27.lib \
../pyside/shiboken-python2.7.lib \
../FooLib-build-Desktop-Release/release/FooLib.lib



2013/1/15 Roman Lacko backup.rla...@gmail.com

 Hi,
 i have prepared the sample projects for you here [1]
 Description:

 This is sample demonstration how to generate simple bindings with shiboken
 python binding generator

 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
 Python 2.7 64bit
 PySide 1.1.2 for Python 2.7 64bit

 To generate and test the bindigs do the following:

 1. Install PySide
 2. Copy content of c:\Python27\Lib\site-packages\PySide to
 BindingTest\PySide folder
 1. Compile FooLib project
 2. Run FooLib\generate_binding.bat
 3. Compile FooLibBinding project
 4. Run FooLibBinding\make_package.bat
 5. Go to generated folder package and run foolib_test.py

 [1] BindingTest.zip -
 https://docs.google.com/file/d/0B0aOk3P0ndoLbkhwbWZncTlUM00/edit



 2013/1/15 Roman Lacko backup.rla...@gmail.com

 I will prepare simple working package for you



 2013/1/15 ZHONG Zhu zhu.zh...@alcatel-sbell.com.cn

  Thank you for your kindly reply!

 I was following this tutorial but just can’t build a working binding on
 Windows.

 Do you have any experience on building the binding on Windows?

 ** **

 *From:* Roman Lacko [mailto:backup.rla...@gmail.com]
 *Sent:* Tuesday, January 15, 2013 4:46 PM
 *To:* ZHONG Zhu
 *Subject:* Re: [PySide] PySide - Qt5 - Swig

 ** **

 I have used this tutorial to create my first bindings:
 http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial. it
 contains downloadable package with full source.

 regards

 R.




___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

2013-01-15 Thread Roman Lacko
sorri, you also have to update the path where you have installed Qt on your
system in files:

pyside\include\PySide\pyside_global.h
FooLib\generate_binding.bat

...replace this c:\Qt\qt-4.8.4-msvc2010-x64 with your path



2013/1/15 Roman Lacko backup.rla...@gmail.com

 btw, you need to update paths to python libs and includes in
 FooLibBinding\FooLibBinding.pro. I have installed python in c:\Python27_64.
 Also if you are using mingw, you will need to change the .lib extension to
 .a

 INCLUDEPATH += ../pyside/include/PySide \
 ../pyside/include/PySide/QtCore \
 ../pyside/include/shiboken \
 c:/Python27_64/include \
 ../FooLib

 LIBS += c:/Python27_64/libs/python27.lib \
 ../pyside/shiboken-python2.7.lib \
 ../FooLib-build-Desktop-Release/release/FooLib.lib



 2013/1/15 Roman Lacko backup.rla...@gmail.com

 Hi,
 i have prepared the sample projects for you here [1]
 Description:

 This is sample demonstration how to generate simple bindings with
 shiboken python binding generator

 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
 Python 2.7 64bit
 PySide 1.1.2 for Python 2.7 64bit

 To generate and test the bindigs do the following:

 1. Install PySide
 2. Copy content of c:\Python27\Lib\site-packages\PySide to
 BindingTest\PySide folder
 1. Compile FooLib project
 2. Run FooLib\generate_binding.bat
 3. Compile FooLibBinding project
 4. Run FooLibBinding\make_package.bat
 5. Go to generated folder package and run foolib_test.py

 [1] BindingTest.zip -
 https://docs.google.com/file/d/0B0aOk3P0ndoLbkhwbWZncTlUM00/edit



 2013/1/15 Roman Lacko backup.rla...@gmail.com

 I will prepare simple working package for you



 2013/1/15 ZHONG Zhu zhu.zh...@alcatel-sbell.com.cn

  Thank you for your kindly reply!

 I was following this tutorial but just can’t build a working binding on
 Windows.

 Do you have any experience on building the binding on Windows?

 ** **

 *From:* Roman Lacko [mailto:backup.rla...@gmail.com]
 *Sent:* Tuesday, January 15, 2013 4:46 PM
 *To:* ZHONG Zhu
 *Subject:* Re: [PySide] PySide - Qt5 - Swig

 ** **

 I have used this tutorial to create my first bindings:
 http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial. it
 contains downloadable package with full source.

 regards

 R.





___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

2013-01-15 Thread Otto Chiu
Hi Roman,
I read somewhere and somebody on the mailing list told me that since Python is 
compiled with MSVC 2008, I need to use it to create my C++ library and PySide 
bindings. Is this not true? Can I use the newer versions of MSVC?

Thanks,
Otto

From: pyside-bounces+ochiu=teslamotors@qt-project.org 
[mailto:pyside-bounces+ochiu=teslamotors@qt-project.org] On Behalf Of Roman 
Lacko
Sent: Tuesday, January 15, 2013 8:07 AM
To: ZHONG Zhu; pyside@qt-project.org
Subject: Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - 
Swig

sorri, you also have to update the path where you have installed Qt on your 
system in files:

pyside\include\PySide\pyside_global.h
FooLib\generate_binding.bat

...replace this c:\Qt\qt-4.8.4-msvc2010-x64 with your path


2013/1/15 Roman Lacko backup.rla...@gmail.commailto:backup.rla...@gmail.com
btw, you need to update paths to python libs and includes in 
FooLibBinding\FooLibBinding.pro. I have installed python in c:\Python27_64.
Also if you are using mingw, you will need to change the .lib extension to .a

INCLUDEPATH += ../pyside/include/PySide \
../pyside/include/PySide/QtCore \
../pyside/include/shiboken \
c:/Python27_64/include \
../FooLib

LIBS += c:/Python27_64/libs/python27.lib \
../pyside/shiboken-python2.7.lib \
../FooLib-build-Desktop-Release/release/FooLib.lib

2013/1/15 Roman Lacko backup.rla...@gmail.commailto:backup.rla...@gmail.com
Hi,
i have prepared the sample projects for you here [1]
Description:

This is sample demonstration how to generate simple bindings with shiboken 
python binding generator

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
Python 2.7 64bit
PySide 1.1.2 for Python 2.7 64bit

To generate and test the bindigs do the following:

1. Install PySide
2. Copy content of c:\Python27\Lib\site-packages\PySide to BindingTest\PySide 
folder
1. Compile FooLib project
2. Run FooLib\generate_binding.bat
3. Compile FooLibBinding project
4. Run FooLibBinding\make_package.bat
5. Go to generated folder package and run foolib_test.py

[1] BindingTest.zip - 
https://docs.google.com/file/d/0B0aOk3P0ndoLbkhwbWZncTlUM00/edit

2013/1/15 Roman Lacko backup.rla...@gmail.commailto:backup.rla...@gmail.com
I will prepare simple working package for you

2013/1/15 ZHONG Zhu 
zhu.zh...@alcatel-sbell.com.cnmailto:zhu.zh...@alcatel-sbell.com.cn
Thank you for your kindly reply!
I was following this tutorial but just can't build a working binding on Windows.
Do you have any experience on building the binding on Windows?

From: Roman Lacko 
[mailto:backup.rla...@gmail.commailto:backup.rla...@gmail.com]
Sent: Tuesday, January 15, 2013 4:46 PM
To: ZHONG Zhu
Subject: Re: [PySide] PySide - Qt5 - Swig

I have used this tutorial to create my first bindings: 
http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial. it contains 
downloadable package with full source.
regards
R.




___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


[PySide] PySide evaluation

2013-01-15 Thread Aaron Richiger
Please all fill in the following evaluation about PySide usage/development.

https://docs.google.com/spreadsheet/viewform?fromEmail=trueformkey=dHVNa1d3dVpvdFdJV1U3THBxVVk2Tnc6MQ

I ask both PySide users and developers to answer the questions, it will take 
you only a few minutes and helps us to get a better image about the following:

- What are your needs regarding the future PySide project
- What are your possibilities to help us improving PySide

You will immediately see an overview of the results as soon as you finished the 
survey and in a few days, I will inform the list about the results.

Thanks a lot for your help!
Aaron




 I'm glad about the amount of traffic on the mailing list. Such
 discussions are either the end of a project or the beginning of a new
 process. Let's hope it's the first step towards the next PySide
 generation. The times of describing a problem and waiting for the
 solution of the development team are definitely over, so if we want this
 project to continue, we have to help ourselves. I think, before deciding
 implementation details, we have to stand one step back and answer the
 following questions one after the other:

 - What are our goals for PySide?
 - Which development team would be available?
 - How much money is needed/available?

 With this information, we can decide which of the defined goals are
 realistic to implement...
 To get, document and archive this information, I created a little
 survey. Please do not answer the questions now already, because I would
 like to get the feedback of some of you about missing/superfuous questions.

 Could some of you visit the following link and just click Continue
 until the end, read everything, but not submit or answer anything and
 give me some feedback:
 https://docs.google.com/spreadsheet/viewform?fromEmail=trueformkey=dHVNa1d3dVpvdFdJV1U3THBxVVk2Tnc6MQ

 Thanks. Then we can start the official survey tomorrow or so.

 Cheers
 Aaron



 Am 14.01.2013 19:16, schrieb John Ehresman:
 On 1/14/13 12:18 PM, Fabien Castan wrote:
   I'm not enthusiastic about a rewrite using swig; it seems to be a lot 
 of
   work for questionable benefits.

 The main benefit could be to get a bigger community and concentrate
 efforts on the binding rules, instead of working on a binding tool.
 I don't think the binding tool as needing a lot of effort.  We do need
 more people fixing bugs and improving the binding rules, but that is the
 case with either tool.  If we were starting from scratch, I'd think swig
 would be something to look at, but we aren't starting from scratch.

   I think much of the work with PySide is
   writing a Python binding given the specifics of how Qt works so it's
   less about using a semi-generic tool such as swiq or shiboken and more
   about how Qt object lifetime works.

 Yes, but users also need to bind their own widgets... And your widgets
 use your core objects... so you need to use the same binding
 tool everywhere.
 A generic binding tool could help for that.
 You are correct that users need to either use one binding tool for all
 qt related interfaces or do extra work to use something else.  This
 would be true with swig or shiboken or anything else.

 Cheers,

 John
 ___
 PySide mailing list
 PySide@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/pyside
 ___
 PySide mailing list
 PySide@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/pyside

___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

2013-01-15 Thread Simon Jagoe
Otto,

You are correct. Generally, you should use the same compiler (MSVC2008).

Building CPython extensions with a different version of Visual Studio can
lead to undesirable behaviour, simply not loading an extension module or
crashing. This is because different versions of the C runtime will be
loaded, and conflict. By far the most robust solution is to use MSVC2008
for everything.

Regards,
Simon


On Tue, Jan 15, 2013 at 4:55 PM, Otto Chiu oc...@teslamotors.com wrote:

  Hi Roman,

 I read somewhere and somebody on the mailing list told me that since
 Python is compiled with MSVC 2008, I need to use it to create my C++
 library and PySide bindings. Is this not true? Can I use the newer versions
 of MSVC?

 ** **

 Thanks,

 Otto

 ** **

 *From:* pyside-bounces+ochiu=teslamotors@qt-project.org [mailto:
 pyside-bounces+ochiu=teslamotors@qt-project.org] *On Behalf Of *Roman
 Lacko
 *Sent:* Tuesday, January 15, 2013 8:07 AM
 *To:* ZHONG Zhu; pyside@qt-project.org
 *Subject:* Re: [PySide] Simple shiboken binding tutorial -- was PySide -
 Qt5 - Swig

 ** **

 sorri, you also have to update the path where you have installed Qt on
 your system in files:

 pyside\include\PySide\pyside_global.h
 FooLib\generate_binding.bat

 ** **

 ...replace this c:\Qt\qt-4.8.4-msvc2010-x64 with your path

 ** **

 ** **

 2013/1/15 Roman Lacko backup.rla...@gmail.com

 btw, you need to update paths to python libs and includes in
 FooLibBinding\FooLibBinding.pro. I have installed python in c:\Python27_64.
 

 Also if you are using mingw, you will need to change the .lib extension to
 .a


 INCLUDEPATH += ../pyside/include/PySide \
 ../pyside/include/PySide/QtCore \
 ../pyside/include/shiboken \
 c:/Python27_64/include \
 ../FooLib

 LIBS += c:/Python27_64/libs/python27.lib \
 ../pyside/shiboken-python2.7.lib \
 ../FooLib-build-Desktop-Release/release/FooLib.lib

 ** **

 2013/1/15 Roman Lacko backup.rla...@gmail.com

 Hi,

 i have prepared the sample projects for you here [1]

 Description:


 This is sample demonstration how to generate simple bindings with shiboken
 python binding generator

 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
 Python 2.7 64bit
 PySide 1.1.2 for Python 2.7 64bit

 To generate and test the bindigs do the following:

 1. Install PySide
 2. Copy content of c:\Python27\Lib\site-packages\PySide to
 BindingTest\PySide folder
 1. Compile FooLib project
 2. Run FooLib\generate_binding.bat
 3. Compile FooLibBinding project
 4. Run FooLibBinding\make_package.bat
 5. Go to generated folder package and run foolib_test.py

 [1] BindingTest.zip -
 https://docs.google.com/file/d/0B0aOk3P0ndoLbkhwbWZncTlUM00/edit

 ** **

 2013/1/15 Roman Lacko backup.rla...@gmail.com

 I will prepare simple working package for you

 ** **

 2013/1/15 ZHONG Zhu zhu.zh...@alcatel-sbell.com.cn

 Thank you for your kindly reply!

 I was following this tutorial but just can’t build a working binding on
 Windows.

 Do you have any experience on building the binding on Windows?

  

 *From:* Roman Lacko [mailto:backup.rla...@gmail.com]
 *Sent:* Tuesday, January 15, 2013 4:46 PM
 *To:* ZHONG Zhu
 *Subject:* Re: [PySide] PySide - Qt5 - Swig

  

 I have used this tutorial to create my first bindings:
 http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial. it
 contains downloadable package with full source.

 regards

 R.

 ** **

 ** **

 ** **

 ** **

 ___
 PySide mailing list
 PySide@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/pyside




-- 
Simon Jagoe
Enthought Ltd
+44 79 312 11 506
sja...@enthought.com
___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Shiboken in python -- was PySide - Qt5 - Swig

2013-01-15 Thread Aaron Richiger
It looks quite promising, but not widely used and quite inactive. I do 
not have enough knowledge about the Qt internals to decide, whether this 
could be an approach.


@Hugo: could you have a quick look at the project description 
(especially the things that are impossible with pybindgen) and let us 
know, if you can already see a big problem? 
http://code.google.com/p/pybindgen/wiki/Features
Or may you tell us somebody else, who is able to filter the available 
binding generator options?


If nobody can see a major problem, it could be worth to contact the 3 
authors and ask them. Because before implementing a code generator 
ourselves, this could be a nice and performant solution.

Aaron

Am 15.01.2013 11:51, schrieb Lucas Tanure:

Can we use http://code.google.com/p/pybindgen/ ?


Lucas A. Tanure Alves
+55 (19) 88176559


___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Shiboken in python -- was PySide - Qt5 - Swig

2013-01-15 Thread Hugo Parente Lima
On Tuesday, January 15, 2013 08:54:51 PM Aaron Richiger wrote:
 It looks quite promising, but not widely used and quite inactive. I do
 not have enough knowledge about the Qt internals to decide, whether this
 could be an approach.
 
 @Hugo: could you have a quick look at the project description
 (especially the things that are impossible with pybindgen) and let us
 know, if you can already see a big problem?
 http://code.google.com/p/pybindgen/wiki/Features
 Or may you tell us somebody else, who is able to filter the available
 binding generator options?

The list of options is very good indeed, just need to know how it works with 
C++ multiple inheritance and the mechanisms available to modify/add/remove 
functions, I found no major problem in the feature list.
 
 If nobody can see a major problem, it could be worth to contact the 3
 authors and ask them. Because before implementing a code generator
 ourselves, this could be a nice and performant solution.
 Aaron
 
 Am 15.01.2013 11:51, schrieb Lucas Tanure:
  Can we use http://code.google.com/p/pybindgen/ ?
  
  
  Lucas A. Tanure Alves
  +55 (19) 88176559
  
  
  ___
  PySide mailing list
  PySide@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/pyside

signature.asc
Description: This is a digitally signed message part.
___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Shiboken in python -- was PySide - Qt5 - Swig

2013-01-15 Thread Owen Kelly
Hi all,

I went through a project where I tried (and failed) to wrap my (non-Qt)
library using Shiboken on Win7, then moved to pybindgen and had some
success.
I am not as strong a computer scientist as the authors of these tools
(pybindgen, shiboken), but I can share some modest experience.

IIRC pybindgen gets its information by scanning data structures generated by
gcc; tools gccxml and pygccxml must be installed for pybindgen to work.
In pybindgen, it was not possible to wrap Cpp function signatures that
include arrays.
In pybindgen, I had challenges to wrap custom exceptions that were
subclassed from various Cpp exceptions.
In the latter case, my roadblock was understanding how to extend pybindgen's
type system to suit my need (maybe better documentation...?).
IIRC, during the wrapping process, errors reported from pybindgen were
useful, but if the error occurred in a supporting tool (gccxml, pygccxml)
then the messages became difficult for me to use.

My wrapping workflow uses cmake and the resulting Python extensions work on
both Win7 and Ubuntu 12.04 .
However to get it all to work, I had to use standard exceptions and also
write some Cpp wrappers to avoid returning arrays.
Also, I did not use any features where objects are created in Cpp and
returned to Python.

None of these comments are to discourage the use of pybindgen as a starting
point for a coding project, just pointing out some limitations of the
present pybindgen.
I would read through the pybindgen bug list conversations where the main
author comments on issues; I think he has good opinions of the
strengths/weaknesses of pybindgen, and likely good suggestions for the best
place to invest efforts in the project.

Regards,

Owen Kelly

-Original Message-
From: pyside-bounces+oekelly=ieee@qt-project.org
[mailto:pyside-bounces+oekelly=ieee@qt-project.org] On Behalf Of Hugo
Parente Lima
Sent: January-15-13 3:08 PM
To: pyside@qt-project.org
Subject: Re: [PySide] Shiboken in python -- was PySide - Qt5 - Swig

On Tuesday, January 15, 2013 08:54:51 PM Aaron Richiger wrote:
 It looks quite promising, but not widely used and quite inactive. I do 
 not have enough knowledge about the Qt internals to decide, whether 
 this could be an approach.
 
 @Hugo: could you have a quick look at the project description 
 (especially the things that are impossible with pybindgen) and let us 
 know, if you can already see a big problem?
 http://code.google.com/p/pybindgen/wiki/Features
 Or may you tell us somebody else, who is able to filter the available 
 binding generator options?

The list of options is very good indeed, just need to know how it works with

C++ multiple inheritance and the mechanisms available to 
C++ modify/add/remove
functions, I found no major problem in the feature list.
 
 If nobody can see a major problem, it could be worth to contact the 3 
 authors and ask them. Because before implementing a code generator 
 ourselves, this could be a nice and performant solution.
 Aaron
 
 Am 15.01.2013 11:51, schrieb Lucas Tanure:
  Can we use http://code.google.com/p/pybindgen/ ?
  
  
  Lucas A. Tanure Alves
  +55 (19) 88176559
  
  
  ___
  PySide mailing list
  PySide@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/pyside

___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

2013-01-15 Thread ZHONG Zhu
Thank you Roman, I completed all steps except for step 5.

1.   Some problem found. In step 3, in FooLibBinding\FooLibBinding.pro,  I 
should be using shiboken-python2.7.a but PySide Windows installer only 
installed shiboken-python2.7.lib. So I have to use MinGW to build Shiboken from 
source to get both libshiboken-python2.7.dll.a and libshiboken-python2.7.dll

2.   After the package been generated, I tried to run foolib_test.py but 
failed.  Error message is like below. Then I used Dependency Walker to load 
foolib.pyd. It complains about QtCore4.dll. Error message is Error: At least 
one module has an unresolved import due to a missing export function in an 
implicitly dependent module. I checked and looks like QtCore4.dll shipped with 
PySide installer is based on Qt 4.8.2 but my local Qt C++ installation is Qt 
4.8.1. Could this be the reason I can't run foolib_test.py? Do I need to 
upgrade my Qt SDK to higher version like 4.8.4?


D:\BindingTest\FooLibBinding\packagefoolib_test.py
Traceback (most recent call last):
  File D:\BindingTest\FooLibBinding\package\foolib_test.py, line 1, in 
module
from foolib import FooClass
ImportError: DLL load failed: The specified procedure could not be found.
===
1. Install PySide
2. Copy content of c:\Python27\Lib\site-packages\PySide to BindingTest\PySide 
folder
1. Compile FooLib project
2. Run FooLib\generate_binding.bat
3. Compile FooLibBinding project
4. Run FooLibBinding\make_package.bat
5. Go to generated folder package and run foolib_test.py

From: Roman Lacko [mailto:backup.rla...@gmail.com]
Sent: Wednesday, January 16, 2013 12:07 AM
To: ZHONG Zhu; pyside@qt-project.org
Subject: Re: Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

sorri, you also have to update the path where you have installed Qt on your 
system in files:

pyside\include\PySide\pyside_global.h
FooLib\generate_binding.bat

...replace this c:\Qt\qt-4.8.4-msvc2010-x64 with your path


2013/1/15 Roman Lacko backup.rla...@gmail.commailto:backup.rla...@gmail.com
btw, you need to update paths to python libs and includes in 
FooLibBinding\FooLibBinding.pro. I have installed python in c:\Python27_64.
Also if you are using mingw, you will need to change the .lib extension to .a

INCLUDEPATH += ../pyside/include/PySide \
../pyside/include/PySide/QtCore \
../pyside/include/shiboken \
c:/Python27_64/include \
../FooLib

LIBS += c:/Python27_64/libs/python27.lib \
../pyside/shiboken-python2.7.lib \
../FooLib-build-Desktop-Release/release/FooLib.lib

2013/1/15 Roman Lacko backup.rla...@gmail.commailto:backup.rla...@gmail.com
Hi,
i have prepared the sample projects for you here [1]
Description:

This is sample demonstration how to generate simple bindings with shiboken 
python binding generator

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
Python 2.7 64bit
PySide 1.1.2 for Python 2.7 64bit

To generate and test the bindigs do the following:

1. Install PySide
2. Copy content of c:\Python27\Lib\site-packages\PySide to BindingTest\PySide 
folder
1. Compile FooLib project
2. Run FooLib\generate_binding.bat
3. Compile FooLibBinding project
4. Run FooLibBinding\make_package.bat
5. Go to generated folder package and run foolib_test.py

[1] BindingTest.zip - 
https://docs.google.com/file/d/0B0aOk3P0ndoLbkhwbWZncTlUM00/edit

2013/1/15 Roman Lacko backup.rla...@gmail.commailto:backup.rla...@gmail.com
I will prepare simple working package for you

2013/1/15 ZHONG Zhu 
zhu.zh...@alcatel-sbell.com.cnmailto:zhu.zh...@alcatel-sbell.com.cn
Thank you for your kindly reply!
I was following this tutorial but just can't build a working binding on Windows.
Do you have any experience on building the binding on Windows?

From: Roman Lacko 
[mailto:backup.rla...@gmail.commailto:backup.rla...@gmail.com]
Sent: Tuesday, January 15, 2013 4:46 PM
To: ZHONG Zhu
Subject: Re: [PySide] PySide - Qt5 - Swig

I have used this tutorial to create my first bindings: 
http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial. it contains 
downloadable package with full source.
regards
R.




___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

2013-01-15 Thread Roman Lacko
Hi,

2013/1/16 ZHONG Zhu zhu.zh...@alcatel-sbell.com.cn

  Thank you Roman, I completed all steps except for step 5.

 **1.   **Some problem found. In step 3, in
 FooLibBinding\FooLibBinding.pro,  I should be using shiboken-python2.7.a
 but PySide Windows installer only installed shiboken-python2.7.lib. So I
 have to use MinGW to build Shiboken from source to get both
 libshiboken-python2.7.dll.a and libshiboken-python2.7.dll

I will try to generate the .a version of  shiboken-python2.7.lib so the
next version of PySide package will contain both .lib and .a versions.

 

 **2.   **After the “package” been generated, I tried to run
 foolib_test.py but failed.  Error message is like below. Then I used
 “Dependency Walker” to load foolib.pyd. It complains about QtCore4.dll.
 Error message is “Error: At least one module has an unresolved import due
 to a missing export function in an implicitly dependent module.” I checked
 and looks like QtCore4.dll shipped with PySide installer is based on Qt
 4.8.2 but my local Qt C++ installation is Qt 4.8.1. Could this be the
 reason I can’t run foolib_test.py? Do I need to upgrade my Qt SDK to higher
 version like 4.8.4?

 **

You can try to replace Qt DLLs from PySide with version you have installed
in system. I will try to regenerate the binding test with mingw...

  **

 D:\BindingTest\FooLibBinding\packagefoolib_test.py

 Traceback (most recent call last):

   File D:\BindingTest\FooLibBinding\package\foolib_test.py, line 1, in
 module

 from foolib import FooClass

 ImportError: DLL load failed: The specified procedure could not be found.*
 ***

 ===

 1. Install PySide
 2. Copy content of c:\Python27\Lib\site-packages\PySide to
 BindingTest\PySide folder
 1. Compile FooLib project
 2. Run FooLib\generate_binding.bat
 3. Compile FooLibBinding project
 4. Run FooLibBinding\make_package.bat
 5. Go to generated folder package and run foolib_test.py

 ** **

 *From:* Roman Lacko [mailto:backup.rla...@gmail.com]
 *Sent:* Wednesday, January 16, 2013 12:07 AM
 *To:* ZHONG Zhu; pyside@qt-project.org
 *Subject:* Re: Simple shiboken binding tutorial -- was PySide - Qt5 - Swig
 

 ** **

 sorri, you also have to update the path where you have installed Qt on
 your system in files:

 pyside\include\PySide\pyside_global.h
 FooLib\generate_binding.bat

 ** **

 ...replace this c:\Qt\qt-4.8.4-msvc2010-x64 with your path

 ** **

 ** **

 2013/1/15 Roman Lacko backup.rla...@gmail.com

 btw, you need to update paths to python libs and includes in
 FooLibBinding\FooLibBinding.pro. I have installed python in c:\Python27_64.
 

 Also if you are using mingw, you will need to change the .lib extension to
 .a


 INCLUDEPATH += ../pyside/include/PySide \
 ../pyside/include/PySide/QtCore \
 ../pyside/include/shiboken \
 c:/Python27_64/include \
 ../FooLib

 LIBS += c:/Python27_64/libs/python27.lib \
 ../pyside/shiboken-python2.7.lib \
 ../FooLib-build-Desktop-Release/release/FooLib.lib

 ** **

 2013/1/15 Roman Lacko backup.rla...@gmail.com

 Hi,

 i have prepared the sample projects for you here [1]

 Description:


 This is sample demonstration how to generate simple bindings with shiboken
 python binding generator

 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
 Python 2.7 64bit
 PySide 1.1.2 for Python 2.7 64bit

 To generate and test the bindigs do the following:

 1. Install PySide
 2. Copy content of c:\Python27\Lib\site-packages\PySide to
 BindingTest\PySide folder
 1. Compile FooLib project
 2. Run FooLib\generate_binding.bat
 3. Compile FooLibBinding project
 4. Run FooLibBinding\make_package.bat
 5. Go to generated folder package and run foolib_test.py

 [1] BindingTest.zip -
 https://docs.google.com/file/d/0B0aOk3P0ndoLbkhwbWZncTlUM00/edit

 ** **

 2013/1/15 Roman Lacko backup.rla...@gmail.com

 I will prepare simple working package for you

 ** **

 2013/1/15 ZHONG Zhu zhu.zh...@alcatel-sbell.com.cn

 Thank you for your kindly reply!

 I was following this tutorial but just can’t build a working binding on
 Windows.

 Do you have any experience on building the binding on Windows?

  

 *From:* Roman Lacko [mailto:backup.rla...@gmail.com]
 *Sent:* Tuesday, January 15, 2013 4:46 PM
 *To:* ZHONG Zhu
 *Subject:* Re: [PySide] PySide - Qt5 - Swig

  

 I have used this tutorial to create my first bindings:
 http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial. it
 contains downloadable package with full source.

 regards

 R.

 ** **

 ** **

 ** **

 ** **

___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside