[PyQt] Conversion from QML

B. B. thebbzoo at gmail.com
Mon Dec 29 21:14:24 GMT 2014


Hello Phil,

I just updated, to the newest versions available.

Qt :
 5.3 -> 5.4

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

Sip:
sip-4.16.5-snapshot-c005a6d2e53e ( around 17 of november ) ->
sip-4.16.6-snapshot-0e9e078d2d18


In python, I have access to a PyQt5.QtQuick.QQuickItem, got from qml
through a slot.

On the QQuickItem object, I call javascript functions, definded in qml, for
example like thisone:

qml:
--------------------
1
Item {

        function thisone( ) {
            return { prefix : "goods" , items : [ idOfItemX, idOfItemY ] }
        }

}
---------------------

I mean, I call in python, on the python QQuickItem. like :
myResult = myPythonQQuickItem.thisone().

In the earlier version, the myResult was a python dict, and myResult[
"items" ] was a python list
containing PyQt5.QtQuick.QQuickItem objects

In the newes version, I only get a myResult is a PyQt5.QtQml.QJSValue, and
one have to do the "marchalling" oneself.


Is this "lack of automatic marchalling to obvious python types" a change
that is going to stay, or is it just an regression in the newest sources
????


using python3.4, the "problem" verified on linux and Mac...


Best regards

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20141229/8c6605ee/attachment.html>


More information about the PyQt mailing list