<div dir="ltr"><div>Thanks!<br></div><div>That'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"><<a href="mailto:oliver.schoenborn@gmail.com" target="_blank">oliver.schoenborn@gmail.com</a>></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 -> 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-> by self.<br>- remove all &, *, ;, }, 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>