Skip to content Skip to sidebar Skip to footer

Creating A C++ Qt Gui For A Python Logic

I was presented with a Python logic for which I need to create a GUI. I want to use Qt for that purpose and ideally I would like to program it in C++, without using the Qt Creator.

Solution 1:

You can create your GUI application using qt c++ and wrap controler logic written in a python api embedding the python api. https://docs.python.org/2/extending/embedding.html But if you have many methods that will be boring to do and you may have some memory leaks if not well written in th c++ side.

Another solution may be using rpc calls to a python api using a webservice (rest api/json rpc ....Etc...). Qt application is client of a python rest api. like this you split the c code from the python one. You can do that using json rpc calls , or other apis,like jcon (https://github.com/joncol/jcon-cpp). You will too be able to find python and QT xml rpc api able to talk together.

swig (http://swig.org) may have some capability , but it is better used in the other way : calling c func from python

Post a Comment for "Creating A C++ Qt Gui For A Python Logic"