[PyQt] Fwd: Re: c++ app integrate PyQt

John Fabiani johnf at jfcomputer.com
Tue Oct 1 15:16:58 BST 2013


On 10/01/2013 02:46 AM, David Boddie wrote:
> On Tue Oct 1 03:05:55 BST 2013, John Fabiani wrote:
>
>> Sorry if I mis-led you somewhere.  The C++ app has been around for many
>> years and is NOT going to be rewritten anytime soon.  I want to
>> integrate a python solution that will allow me to create new content
>> using python all running within the C++ app loop.  I'm hoping I can do
>> it with PyQt.  Creating the library would work - it would allow me to
>> test and work in python.  There are only a few things I need the python
>> to know about from the C++ side - the login data, a couple of pieces of
>> data, and one Class.  After those minor things I don't need a thing.
>> That said, it would be nice if the python side could call up some of the
>> C++ forms.
> I've done things with embedding in the past and never really liked the
> process of starting up a Python interpreter from within a C++ application.
>
> For something I'm currently working on, I decided to do what Matt suggests,
> which is to build the application as a library - for a qmake-based build
> system, this basically means changing the TEMPLATE line in its .pro file to
>
>    TEMPLATE = lib
>
> Then you create wrappers for the classes you need. If your application's
> main() function is simple - creates an application, creates a window, opens
> it - then you can start by creating a wrapper for the window class and
> writing an equivalent Python script to start the application.
>
> I would put some examples on the (unofficial) PyQt Wiki but it appears to
> have disappeared again.
>
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
If you would forward an example to me it would very helpful.  I think 
both of you are suggesting that I wrap the C++ (BTW a very large app) 
and then write the entire program using PyQt. Is that correct.  You also 
suggest you succeeded integrating PyQt into a C++ but were disappointed 
with the results?  Could you explain beyond -you didn't like loading a 
python interpreter.  What was the down side.  Load time seems very fast 
with PythonQt.  I don't know what the load time of PyQt would be - but 
if it was under 10 seconds - that would be ok.

I may have to move to QML and javascript (a terrible language) - short 
of wrapping everything and or rewriting the entire program.

BTW thanks guys for helping me.

Johnf






More information about the PyQt mailing list