Re: [PySide] Can't find QIdentityProxyModel from QtGui or QtCore

2013-09-15 Thread ZHONG Zhu
Hope someone can help confirm this. If it's missing, can PySide team include 
this class in? Thanks!

-Original Message-
From: pyside-bounces+zhu.zhong=alcatel-sbell.com...@qt-project.org 
[mailto:pyside-bounces+zhu.zhong=alcatel-sbell.com...@qt-project.org] On Behalf 
Of ZHONG Zhu
Sent: Friday, September 13, 2013 4:13 PM
To: pyside@qt-project.org
Subject: [PySide] Can't find QIdentityProxyModel from QtGui or QtCore

Is QIdentityProxyModel built in PySide 1.2.1?
___
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] Can't find QIdentityProxyModel from QtGui or QtCore

2013-09-13 Thread ZHONG Zhu
Is QIdentityProxyModel built in PySide 1.2.1?
___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


Re: [PySide] Possbile to syntax hightlight the content of a QTreeWidget item?

2013-01-24 Thread ZHONG Zhu
Thank you Aaron, that works!

From: pyside-bounces+zhu.zhong=alcatel-sbell.com...@qt-project.org 
[mailto:pyside-bounces+zhu.zhong=alcatel-sbell.com...@qt-project.org] On Behalf 
Of Aaron Richiger
Sent: Thursday, January 24, 2013 6:36 PM
To: pyside@qt-project.org
Subject: Re: [PySide] Possbile to syntax hightlight the content of a 
QTreeWidget item?

Hello Zhu!

For QTreeWidget, you can use setItemWidget() to set any widget you want for 
this item. I used it to place a QLabel with colorized text in the item. To 
colorize the text of a QLabel you can use html. To generate the correct html 
for any assignment statement with binary operations of any variable, I 
implemented a very simple AST model, I guess you have something similar for 
your code. All nodes have a to_html() method to get colorized html output for 
this node. Here is a simple working example:

## Code #
#!/usr/bin/python

import sys
from PySide.QtGui import *


class AstNode(object):
Base class for all nodes of the code model.

def __init__(self):
self.color = black

def get_colorized_html_for(self, text):
Embed text in html tags setting the text font.

return 'font color=%s%s/font' % (self.color, text)


class Assignment(AstNode):
Model for an assignment statement.

def __init__(self, left, right):
super(Assignment, self).__init__()
self.left = left
self.right = right

def to_html(self):
Return html text to represent this node with syntax highlighting.

return self.left.to_html() + \
self.get_colorized_html_for( = ) + \
self.right.to_html()


class BinaryOp(AstNode):
Model for a binary operation, such as a + b.

def __init__(self, left, right, operator):
super(BinaryOp, self).__init__()
self.color = #FF # example for hex rgb, analogous to blue
self.left = left
self.right = right
self.operator = operator

def to_html(self):
Return html text to represent this node with syntax highlighting.

return self.left.to_html() + \
self.get_colorized_html_for(' ' + self.operator + ' ') + \
self.right.to_html()


class Variable(AstNode):
Model for a variable.

def __init__(self, name):
super(Variable, self).__init__()
self.name = name
self.color = red

def to_html(self):
Return html text to represent this node with syntax highlighting.

return self.get_colorized_html_for(self.name)


class TreeWidgetExample(QTreeWidget):

def __init__(self, parent=None):
super(TreeWidgetExample, self).__init__(parent)
self.setHeaderLabels([Action, Parameter])
self.setColumnCount(2)
root = QTreeWidgetItem(self, [function])
children = QTreeWidgetItem(root, [eval])

# Build code model for $result = $a + $b
result_var = Variable($result)
a_var = Variable($a)
b_var = Variable($b)
addition = BinaryOp(a_var, b_var, +)
assignment = Assignment(result_var, addition)

# Set a QLable as ItemWidget for the code column
self.setItemWidget(children, 1, QLabel(assignment.to_html(), self))


def main():

app = QApplication(sys.argv)
ex = TreeWidgetExample()
ex.show()
sys.exit(app.exec_())

if __name__ == '__main__':
main()

 End Code ##



Am 24.01.2013 04:03, schrieb ZHONG Zhu:
I'm using QTreeWidget to parse/show/edit one of our internal language. Now 
user wants to have syntax highlight feature. I was able to highlight the whole 
item, for instance, the comment Action and the whole Parameter.

When it comes to the content within an item, such as $result = $a + $b, I 
can't find a way to highlight individual variables ($result/$a/$b). Anyone has 
any experience on this? How? Thanks in advance!

BR

Zhu
[cid:image001.jpg@01CDFAE0.6EB0C7F0]





___

PySide mailing list

PySide@qt-project.orgmailto:PySide@qt-project.org

http://lists.qt-project.org/mailman/listinfo/pyside

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


[PySide] Possbile to syntax hightlight the content of a QTreeWidget item?

2013-01-23 Thread ZHONG Zhu
I'm using QTreeWidget to parse/show/edit one of our internal language. Now 
user wants to have syntax highlight feature. I was able to highlight the whole 
item, for instance, the comment Action and the whole Parameter.

When it comes to the content within an item, such as $result = $a + $b, I 
can't find a way to highlight individual variables ($result/$a/$b). Anyone has 
any experience on this? How? Thanks in advance!

BR

Zhu


inline: Picture (Device Independent Bitmap) 1.jpg___
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-20 Thread ZHONG Zhu
Same as you, I benefit from Roman's tutorial package a lot.
I was on-and-off on trying to work out a binding for more than 6 months! Thank 
you, Roman!
When the MinGW shiboken build is ready, I'll start to move my Qt C++ 
application to PySide.

From: sable.sourcefo...@gmail.com [mailto:sable.sourcefo...@gmail.com] On 
Behalf Of Sébastien Sablé Sablé
Sent: Saturday, January 19, 2013 1:10 AM
To: Roman Lacko
Cc: ZHONG Zhu; pyside@qt-project.org
Subject: Re: [PySide] Simple shiboken binding tutorial -- was PySide - Qt5 - 
Swig

Many thanks Roman!
I have been able to run your tutorial, and then adapt it to start binding a 
library on which I work.
I have only binded 4 classes for the moment out of around one hundred, and that 
required quite a lot of trial and error, but it gets easier as I learn the 
typesystem syntax.
That tutorial got me started and probably saved me plenty hours of setting up 
the project.

cheers

Sébastien Sablé
___
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-16 Thread ZHONG Zhu
Now I have 6 files in package folder.
D:\BINDINGTEST\FOOLIBBINDING\PACKAGE
FooLib.dll
foolib.pyd
foolib_test.py
libshiboken-python2.7.dll
QtCore.pyd
QtCore4.dll


1.   Run foolib_test.py with QtCore4.dll copied from PySide 1.1.2 folder. I 
got below error.


D:\BindingTest\FooLibBindingfoolib_test.py
Traceback (most recent call last):
  File D:\BindingTest\FooLibBinding\foolib_test.py, line 1, in module
from foolib import FooClass
ImportError: No module named foolib


2.   Copied D:\Qt\4.8.1\bin\QtCore4.dll from my Qt 4.8.1 installation to 
D:\BINDINGTEST\FOOLIBBINDING\PACKAGE. Run foolib_test.py again, I got below 
error.


D:\BindingTest\FooLibBinding\packagefoolib_test.py
ImportError: could not import module 'PySide.QtCore'
Fatal Python error: can't initialize module foolib

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Could you help to have a check the cause of the error message?

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

Hi,

2013/1/16 ZHONG Zhu 
zhu.zh...@alcatel-sbell.com.cnmailto: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.commailto:backup.rla...@gmail.com]
Sent: Wednesday, January 16, 2013 12:07 AM
To: ZHONG Zhu; pyside@qt-project.orgmailto: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

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

2013-01-16 Thread ZHONG Zhu
I re-installed everying: Qt 4.8.4 for VC2010+ PySide 1.1.2. Then recompiled the 
package following your instruction. At last, the test file foolib_test.py 
passed fine. That's really terrific! Thank you so much Roman!

Still hope you can generate a PySide Windows installer on MinGW.

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

2013/1/16 ZHONG Zhu 
zhu.zh...@alcatel-sbell.com.cnmailto:zhu.zh...@alcatel-sbell.com.cn
Now I have 6 files in package folder.
D:\BINDINGTEST\FOOLIBBINDING\PACKAGE
FooLib.dll
foolib.pyd
foolib_test.py
libshiboken-python2.7.dll
QtCore.pyd
QtCore4.dll


1.   Run foolib_test.py with QtCore4.dll copied from PySide 1.1.2 folder. I 
got below error.


D:\BindingTest\FooLibBindingfoolib_test.py
Traceback (most recent call last):
  File D:\BindingTest\FooLibBinding\foolib_test.py, line 1, in module
from foolib import FooClass
ImportError: No module named foolib


2.   Copied D:\Qt\4.8.1\bin\QtCore4.dll from my Qt 4.8.1 installation to 
D:\BINDINGTEST\FOOLIBBINDING\PACKAGE. Run foolib_test.py again, I got below 
error.


D:\BindingTest\FooLibBinding\packagefoolib_test.py
ImportError: could not import module 'PySide.QtCore'
Fatal Python error: can't initialize module foolib

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Could you help to have a check the cause of the error message?

I thing it's because you are using mingw and PySide was compiled with msvc. I 
will try to create PySide distribution with mingw, but it takes more time. Best 
would be if you can use msvc compiler (VS 2008/2010 Express is free).


From: Roman Lacko 
[mailto:backup.rla...@gmail.commailto:backup.rla...@gmail.com]
Sent: Wednesday, January 16, 2013 3:38 PM
To: ZHONG Zhu
Cc: pyside@qt-project.orgmailto:pyside@qt-project.org
Subject: Re: Simple shiboken binding tutorial -- was PySide - Qt5 - Swig

Hi,

2013/1/16 ZHONG Zhu 
zhu.zh...@alcatel-sbell.com.cnmailto: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.commailto:backup.rla...@gmail.com]
Sent: Wednesday, January 16, 2013 12:07 AM
To: ZHONG Zhu; pyside@qt-project.orgmailto: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

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] PySide - Qt5 - Swig

2013-01-14 Thread ZHONG Zhu
I've been using Qt for a while but I'm a newbie to PySide. To me, PySide it's a 
brilliant product because of its Python syntax and all these Qt experience I 
had could be reused. Writing code with PySide is always an happy experience for 
me and I do like it.

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?


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


[PySide] Can I use SIP to generate Python binding for my Qt C++ library then call it in PySide?

2013-01-13 Thread ZHONG Zhu
I have to choose PySide due to the license. But its Shiboken tool is so lack of 
documentations. I can't successfuly generate a binding for my Qt C++ libraries.
Looks like SIP is more mature at least on the documentation part. Is it 
possible for me to generate the binding using SIP, then run my python code on 
PySide to call the binding? My users' environment would be Windows XP + Python 
2.7 + PySide 1.1.2 (Window installer based, installed to 
C:\Python27\Lib\site-packages\PySide).


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


Re: [PySide] how to make cmake find a package configuration file

2013-01-09 Thread ZHONG Zhu
thank you Andy! I'll follow your guide and have a try.

-Original Message-
From: Andy Kittner [mailto:and...@gmx.de] 
Sent: Wednesday, January 09, 2013 5:23 PM
To: ZHONG Zhu
Cc: pyside@qt-project.org
Subject: Re: [PySide] how to make cmake find a package configuration file

On 09.01.2013 09:55, ZHONG Zhu wrote:
 Cool, that works! Thank you Andy!
 Believe I'm very close to complete compiling this 
 http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial

 Do you happen to know how I can get find_package(PySide REQUIRED) pass the 
 cmake?

 I installed PySide with a Windows binary installer. It's located under python 
 at D:\Python27\Lib\site-packages\PySide
 so there is no FindPySide.cmake or PySideConfig.cmake available.
Hmm I don't think the binary installer bundles the required headers, 
libs, etc. to build pyside-bindings. Last time I played with it I build 
pyside from source using the setup scripts from here:
   https://github.com/PySide/pyside-setup

You need either git or you can copy the required modules into the 
sources/ directory.

Then `python setup.py build` should build everything.
Afterwards there should be a directory there called install or 
pyside_install or something like that where you will find the required 
cmake files.

Oh, and I remember I needed to change some backslashes to forward 
slashes in at least one of those .cmake files because otherwise I got 
syntax errors from cmake. It's been quite a while so it may be fixed 
already, or maybe it was just a quirk of my cmake version.

PS: sorry for not replying to the list, hit the wrong button :/

Regards,
Andy


 -Original Message-
 From: Andy Kittner [mailto:and...@gmx.de]
 Sent: Wednesday, January 09, 2013 4:42 PM
 To: ZHONG Zhu
 Subject: Re: [PySide] how to make cmake find a package configuration file

 On 09.01.2013 09:00, ZHONG Zhu wrote:
 [...]
 Add the installation prefix of Shiboken to CMAKE_PREFIX_PATH or set
 Shiboken_DIR to a directory containing one of the above files.  If
 Shiboken provides a separate development package or SDK, be sure it has
 been installed.
 I do have Shiboken compiled and installed to C:\Program Files\shiboken. And 
 I can see there are cmake files like ShibokenConfig.cmake, 
 ShibokenConfig-python2.7.cmake, ShibokenConfigVersion.cmake under folder 
 C:\Program Files\shiboken\lib\cmake\Shiboken-1.1.2
 how do I let the cmake know it should search for ShibokenConfig.cmake in 
 that folder?

 IIRC you need to add the parameter
 -DShiboken_DIR=C:\Program Files\shiboken\lib\cmake\Shiboken-1.1.2 when
 you call cmake (with the quotes due to the space in the path).


 Regards,
 Andy


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


[PySide] Why do you choose PySide?

2012-12-13 Thread ZHONG Zhu
Hi All,

An interesting idea came to my mind yesterday that I'd like to know why people 
choose PySide.

I'll start from myself first. I use Qt (C++) in my daily work for years. 
Reasons why I'd like to use PySide:
1.  LGPL
2.  Fast prototype my ideas, which will be later implemented in Qt (C++ 
version)
3.  Use it to learn Python language

BR,

Zhu
--
EasyTest (Alcatel-Lucent automation test tool) NOW FREE on internet at
https://github.com/EasyTest2012/EasyTesthttps://github.com/EasyTest2012/EasyTest/downloads



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


[PySide] PySide_Binding_Generation_Tutorial

2012-11-28 Thread ZHONG Zhu
I'm new to Pyside and I was trying to follow this tutorial to generate a 
binding but always have problem finish the last step 
http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial%3A_Module_5_Building_the_generator

There are always errors like below. Anyone can help me on this? I'm working on 
WindowsXP with Qt4.8.1, Python27 and PySide1.1.2(installed through a binary 
installer). Thank you in advance!

g++ -Wl,-s -mthreads -shared -Wl,--out-implib,release\libfoo.a -o 
release\foo.dll release/foo_module_wrapper.o release/
ath_wrapper.o  -Ld:\Qt\4.8.1\lib -LD:/Python27/libs 
-LD:/Python27/Lib/site-packages/PySide D:/Python27/libs/python27.
ib D:/Python27/Lib/site-packages/PySide/pyside-python2.7.lib 
D:/Python27/lib/site-packages/PySide/shiboken-python2.7.li
 -LD:/binding-tutorial/libfoo -lfoo -lQtGui4 -lQtCore4
Info: resolving vtable for Math by linking to __imp___ZTV4Math (auto-import)
Creating library file: release\libfoo.a
d:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: 
warning: auto-importing has been activated
ithout --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing 
symbols from auto-imported DLLs.
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0x63): undefined 
reference to `Shiboken::Conversions::conver
ibleDictTypes(SbkConverter*, bool, SbkConverter*, bool, _object*)'
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0x90): undefined 
reference to `Shiboken::Conversions::conver
ibleSequenceTypes(SbkConverter*, _object*)'
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0xbd): undefined 
reference to `Shiboken::Conversions::conver
ibleSequenceTypes(SbkConverter*, _object*)'
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0x149): undefined 
reference to `Shiboken::Conversions::copyT
Python(SbkConverter*, void const*)'
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0x2e8): undefined 
reference to `Shiboken::Conversions::copyT
Python(SbkConverter*, void const*)'
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0x3b9): undefined 
reference to `Shiboken::Conversions::pytho
ToCppCopy(SbkConverter*, _object*, void*)'
release/foo_module_wrapper.o:foo_module_wrapper.cpp:(.text+0x44d): undefined 
reference to `Shiboken::Module::import(cha
___
PySide mailing list
PySide@qt-project.org
http://lists.qt-project.org/mailman/listinfo/pyside


[PySide] where to find the user guide for Shiboken

2012-11-14 Thread ZHONG Zhu
hi,

I'm trying to use Shiboken to wrap my shared library file (.dll file, on 
WindowsXP, based on Qt) with Shiboken. But seems there's not enough guide on 
the qt site. Can anyone point me to the right web page? Thanks!

BR,

Zhu

--
EasyTest (Alcatel-Lucent automation test tool) NOW FREE on internet at
https://github.com/EasyTest2012/EasyTesthttps://github.com/EasyTest2012/EasyTest/downloads



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


[PySide] where to find doc for Shiboken

2012-09-11 Thread ZHONG Zhu
Hi all,

Do you know where to find user guide for Shiboken?

Thanks,

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