Best way to add python scripting into QT application?

核能气质少年 提交于 2019-12-08 19:34:23

问题


I have a QT 4.6 application (C++ language) and i need to add python scripting to it on windows platform. Unfortunately, i never embed python before, and it seems to be a lot of different ways to do so. Can anyone share his wisdom and point me into some articles/documentation i can read to perform a specified task in less painful way?


回答1:


Edit:

You can use PythonQt (not PyQt) that allow you to use Python with Qt. I think this is what you are searching for.

Here a documentation on the official website: http://doc.qt.digia.com/qq/qq23-pythonqt.html.




回答2:


You should take a look at PythonQt. From the homepage:

PythonQt is a dynamic Python binding for Qt. It offers an easy way to embed the Python scripting language into your Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x. In contrast to PyQt , PythonQt is not a complete Python wrapper around the complete Qt functionality. So if you are looking for a way to write complete applications in Python using the Qt GUI, you should use PyQt.

If you are looking for a simple way to embed Python objects into your C++/Qt Application and to script parts of your application via Python, PythonQt is the way to go!

Build/installation instructions for Windows is near the bottom of the page.



来源:https://stackoverflow.com/questions/1908269/best-way-to-add-python-scripting-into-qt-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!