[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Fwd: Re: Convert code from C++ to Python
From:       "Chris O'Halloran" <cmoman () gmail ! com>
Date:       2016-01-09 8:03:49
Message-ID: CAAXZQmOx9F-BVyigQa6egaJooGbJzjQfHjVhKdN8aOErqTTP6Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks!
That's cleared one or two things up.

Chris

On 7 January 2016 at 16:28, oliver <oliver.schoenborn@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@riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>Thanks!<br></div><div>That&#39;s cleared one or two things \
up.<br><br></div><div>Chris<br></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On 7 January 2016 at 16:28, oliver <span dir="ltr">&lt;<a \
href="mailto:oliver.schoenborn@gmail.com" \
target="_blank">oliver.schoenborn@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Pedro,  <div>I forgot a couple steps to \
convert a C++ Qt example code to PyQt. The list may seem daunting but it is really \
straightforward:<span class=""><br><br>- replace the includes by imports from \
PyQt5</span></div><div><span class="">- replace all -&gt; and :: by dot<br></span>- \
replace all object instantiations by Pythonic form foo=Foo(…) (regardless of new / \
local)<br>- replace all { by colon<br>- fix constructors to be named __init__ <br>- \
move data members from class, and initializers  from constructor, into __init__ \
body<br>- convert derivation to python syntax such as class Foo(BaseClass)<br>- add \
self. as appropriate and replace this-&gt; by self.<br>- remove all &amp;, *, ;, }, \
parentheses around if/while/etc conditions, type declarations (return types, \
parameter types), virtuals, consts, and deletes<br>- (other TBD?)<span class=""><br>- \
convert custom signals to use pyqtSignal at class level<br>- convert connections to \
use new style pythonic syntax<br></span>- run and fix iteratively until works \
</div></div> <br>_______________________________________________<br>
PyQt mailing list      <a \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br> <a \
href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" \
target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br></div>



[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic