[PyQt] Conversion from QML

Phil Thompson phil at riverbankcomputing.com
Mon Jan 5 10:04:37 GMT 2015


On 03/01/2015 5:10 pm, B. B. wrote:
> Hey Phil,
> 
> The error had actually been easier explained making a short example 
> from
> the beginning...
> 
> Attatched is the sources for a very small program that demostrate what 
> I
> mean.
> The introspection is done just by printing to the console.
> I print out in 2 sections - the first "makes sence" with the new 
> source,
> the second makes sence with the old sources.
> 
> You will notice in the second - with the old sources - the result from 
> the
> "getStuff" function is python dicts and lists.
> 
> Which if a much cleaner interface than the QJSValues the getStuff 
> returns
> with the nevest sources.. :-)

It's a change in behaviour in Qt v5.4 - nothing to do with PyQt.

I could implement the mapping protocol for QJSValue so that __getitem__ 
calls property(), __setitem__ calls setProperty() and __delitem__ calls 
deleteProperty(). Would that help?

Phil


More information about the PyQt mailing list