The author recently in the development of QT, and then need to use the script to expand the program inside, it is natural to think of Python, degree Niang found an artifact, which is today to introduce the protagonist: PYTHONQT
Today first introduce the next PYTHONQT under the windows of the installation and compilation, follow-up will do a series to introduce the PYTHONQT in the project used in the pits and solutions.
1. Introduction
PYTHONQT is an open-source connection to the SourceForge on the Qt and Python framework, home address http://pythonqt.sourceforge.net/, is currently updated to version 3.0, the specific introduction can visit the homepage to understand;
2. Download and install
Access link: https://sourceforge.net/projects/pythonqt/files/pythonqt/can download all versions of the framework, the author uses the latest version 3.0, the following to start compiling:
After the decompression can see a build directory, which contains a configuration file, before the formal compilation of the configuration file needs to be modified
1 # Profile to include and link Python2 3# variable to your Python version (2.6,2.7,3.3, ...)4Win32::P ython_version= -5 6 7 # When using the ' Prebuild Python installer, this'll be:8Python_path =c:\Python279Python_lib =C:\Python27\libsTen One# checkifDebug or Release ACONFIG (Debug, Debug|release) { -Debug_ext =_d -}Else { theDebug_ext = - } - -Win32::includepath + = $ $PYTHON _path/pc $ $PYTHON _path/include +Win32::libs + = $ $PYTHON _lib/python$${python_version}$${debug_ext}.lib
Copy the above code to the original PYTHON.PRF, and change the Win32::P ython_version to the PYTHON version you installed,Python_path,python_lib Modify it to your own Python directory.
Then execute Createsolution.bat build vs Project file, you can use VS to compile the project, (only need to compile the project Pythonqt,pythonqt_qtall, others as examples and test cases)
Since the author does not install the debug version of Python, so when compiling PYTHONQT, the debug version is compiled, the need to debug students need to install the debug version of Python before compiling PYTHONQT debug version.
It is then necessary to note that in the official documentation, Python requires a description of the support library version:
- Qt 4.x (QT 4.7 and QT 4.8 recommended)
- QT 5.x (tested with QT 5.0, 5.3 and 5.4)
PYTHONQT support version for Python
- Python 2 (>= python 2.6)
- Python 3 (>= python 3.3)
It is recommended that qt4.7,4.8 run the test case in 5.0,5.3,5.4, and that it can be used in other versions, if you have a high system stability requirement or if you follow the official documentation recommendations.
Compiled installation package: Http://files.cnblogs.com/files/zhangzhiming/PythonQt3.0-win-x86-Qt5.5.1-Python2.7.3.zip
Original address: http://www.cnblogs.com/zhangzhiming/p/5407644.html
Technology sharing QQ Group: 527698177 (limited to Sichuan region)
PYTHONQT compilation under Windows