[Qt-interest] Integrating PyQt into a Python-enabled Qt application

Bob Hood bhood2 at comcast.net
Thu Jul 29 03:34:23 CEST 2010


On 7/27/2010 11:58 PM, Mark Summerfield wrote:
> On Tue, 27 Jul 2010 22:11:57 -0700
> Bob Hood <bhood2 at comcast.net> wrote:
>> I'm looking for advice on a approach to this.  I've not yet attempted
>> anything.
>>
>> I currently have a Qt-based application that has Python well
>> integrated via SWIG.  I'm interested in allowing Python scripts that
>> execute from within my application to use PyQt for their GUI
>> interfaces.  I can imagine how this might introduce some difficulties
>> due to each Qt-based system needing their own event loops.
>>
>> If the user installs PyQt into the Python Lib folder of my
>> application's installation, how should I structure or alter my
>> Qt-based binary application to allow the event loops of one or more
>> PyQt windows to "piggy-back" on the main thread's Qt event loop?
>>
>> Has anybody attempted/solved this one already?
>
> Have you considered using PythonQt http://pythonqt.sourceforge.net/
> which is designed to provide Python bindings to Qt _within_ C++/Qt
> applications?

Thanks for the reply, Mark.

While I would not discount the possibility of supporting something like
PythonQt, this is not a case where I have the option to select a
different Qt/Python combo.  This is a customer mandate, so I need to
specifically support PyQt.

I already have Python bound to my Qt application via SWIG.  I am
specifically concerned about how to integrate PyQt into that arrangement
so it can function at the same time as my main thread's GUI without ugly
event delays.




More information about the Qt-interest-old mailing list