[PyQt] Fwd: I created a demo how to embed PyQt into C++ with some meta programming
Marcus Lindblom Sonestedt
macke at yar.nu
Mon Aug 15 10:46:29 BST 2011
2011/8/15 Phil Thompson <phil at riverbankcomputing.com>
> 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
> > 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.
I wrote that mapping the property names to having the first letter in
_uppercase_, they would not clash with the functions.
This works for Qt at least, which is consistent in this case, and would
(If it works for Henning...)
Though, I agree it's a bit hackish, but IMHO, it would be worth it to bring
Qt properties into Python.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt