[PyQt] Fwd: Re: Convert code from C++ to Python
Chris O'Halloran
cmoman at gmail.com
Sat Jan 9 08:03:49 GMT 2016
Thanks!
That's cleared one or two things up.
Chris
On 7 January 2016 at 16:28, oliver <oliver.schoenborn at gmail.com> wrote:
> Pedro,
> I forgot a couple steps to convert a C++ Qt example code to PyQt. The list
> may seem daunting but it is really straightforward:
>
> - replace the includes by imports from PyQt5
> - replace all -> and :: by dot
> - replace all object instantiations by Pythonic form foo=Foo(…)
> (regardless of new / local)
> - replace all { by colon
> - fix constructors to be named __init__
> - move data members from class, and initializers from constructor, into
> __init__ body
> - convert derivation to python syntax such as class Foo(BaseClass)
> - add self. as appropriate and replace this-> by self.
> - remove all &, *, ;, }, parentheses around if/while/etc conditions, type
> declarations (return types, parameter types), virtuals, consts, and deletes
> - (other TBD?)
> - convert custom signals to use pyqtSignal at class level
> - convert connections to use new style pythonic syntax
> - run and fix iteratively until works
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160109/ee1493c6/attachment-0001.html>
More information about the PyQt
mailing list