[PyQt] Conversion from QML

B. B. thebbzoo at gmail.com
Thu Jan 8 05:36:01 GMT 2015


Didn't you always have to call toString() etc. to get the actual values,
even with Qt v5.3?

>
> If so then implementing the mapping protocol should allow you to write
> code that would work with both v5.3 and v5.4 without needing to be changed.
>
> Phil
>


No, It was not neccesary, because there was no QJSValue in what the
function returned.


With the combination :
Qt :
 5.3

PyQt :
PyQt-gpl-5.4-snapshot-
15b37c22d541  ( from around 17 of november )

Sip:
sip-4.16.5-snapshot-c005a6d2e53e ( around 17 of november )

All values returned were already "python values":
( from the example, earlier in this thread ):


The return value with combination Qt5.3 , PyQt, sip from 17/11 )

 {'texts': [<PyQt5.QtCore.QObject object at 0x7f1d6c11fc18>], 'good': 'yes'}



The return value with Qt5.4 , PyQt, sip from about 25/12, is that QJSValue:

<PyQt5.QtQml.QJSValue object at 0x7f2563921898>

This is the QJSValue type, one have to pack out, to get the "python one"
like the one above...



Because the return value earlier contained "pure python", like str, dict
and list, along with PyQt5 objects, like QObjects,
I thought the PyQt5 earlier did a processing, prepareing the result. But
that was somehow lost in progress since november.

This was a pure guess, I have really not looked into changes from qt-5.3 to
qt-5.4, or in any PyQt sources....


Because of you question, I see a little hope for the smooth easier old way
of returning :-)..
I will try to run the example a crossed sources, ( New PyQt5 with qt-5.3 ,
or PyQt5 from november with qt-5.4 - if that is possible ). Just to
verify...


Best Regards
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150108/6cedb3fa/attachment.html>


More information about the PyQt mailing list