Integration of Python console into a GUI C++ application

ぃ、小莉子 提交于 2019-12-02 22:04:59
Gregory Pakosz

Since you're apparently wanting to embed a Python interpreter to use Python as a scripting language in a what seems to be a Qt application, I suggest you have a look at PythonQt.

With the PythonQt module, Python scripts will be able to interact with the GUI of your host application.

Unlike PyQt and Qt Jambi, PythonQt is not designed to provide support for developers writing standalone applications. Instead, it provides facilities to embed a Python interpreter and focuses on making it easy to expose parts of the application to Python.

If I understood your needs correctly, that's all you need.

PyQt and PySide (officially supported by Nokia) aim at accessing Qt features from a Python program by providing bindings.

It's possible to embed PyQt in your application (even a Qt application) and your Python scripts will be able to provide their own GUI while interacting with your application scripting API.

About thread safety, Qt offers a thread-safe way of posting events, and signal-slot connections across threads.

References:

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