[PyQt] Conversion from QML
Phil Thompson
phil at riverbankcomputing.com
Fri Jan 2 16:15:50 GMT 2015
On 29/12/2014 9:14 pm, B. B. wrote:
> 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...
Can you send me a short, complete example that demonstrates the problem.
Phil
More information about the PyQt
mailing list