Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
-
Ubuntu 9.10 32bit (and WinXP 32bit)
Description
If I have a Q_INVOKABLE QSize foo() method, and add the object as a context property, QML does not seem to allow to return foo().width, foo.width() nor foo.width.
Calling console.log(foo()) returns "QVariant(QSize)" but there seems to be no way to access its properties. However, using Q_PROPERTY(QSize foo READ foo) works and I get the value as expected, with foo.width.
Calling console.log(foo) when it is a property returns [object Object], suggesting that some additional processing is done for Q_PROPERTYs.
As the documentation claims that support for QSize/QPoint etc should be in place, this should work from both declared properties and invokable functions.