[PyQt] I created a demo how to embed PyQt into C++ with some meta programming

Phil Thompson phil at riverbankcomputing.com
Mon Aug 15 10:42:30 BST 2011


On Mon, 15 Aug 2011 11:28:04 +0200, Marcus Lindblom Sonestedt
<marcus.s.lindblom at gmail.com> wrote:
> Henning Schröder skrev 2011-08-10 20:55:
>> Hello,
>> please see http://www.henning-schroeder.de/embeddedpyqt/ if you are
>> interested in this topic.
>> The idea was to create easy access between Python and C++ and
>> providing a simple api to the end user.
>> Feedback welcome.
>> Regards
>> Henning
> 
> Neat! I'll definitely have a look at this someday in the future (as we 
> do mix C++ and Python quite heavily in our apps.)
> 
> I especially like that you've mapped Qt properties to Python using upper

> case on the first letter 
>
(http://www.henning-schroeder.de/embeddedpyqt/using.html#differences-to-sip).
> 
> That would be awesome to have in PyQt. It doesn't seem _that_ hard to 
> get in there, if Phil is willing of course. ;)

It is hard...

In C++ the property names are in a different namespace to the class
methods so their names can clash, for example QObject's objectName property
and objectName() method. In Python they are in the same namespace (the
class dict) and so cannot co-exist.

Phil


More information about the PyQt mailing list