Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0 Beta 1
-
None
-
linux
-
4709f30b26042427b225dd164648e3f5907c9d33
Description
Cannot assign values to properties of type QJSValue from QML.
Plugin exposes the property like this:
class JsonDbCachingListModel : public QObject { Q_PROPERTY(QJSValue customData READ customData WRITE setCustomData) QJSValue customData() const; void setCustomData(const QJSValue &newData); }
When assigning value in QML like this
JsonDb.JsonDbCachingListModel { customData: customHeadersCallback.toString() } function customHeadersCallback(item) { return { 'Header' : "Sect" }; }
The following error is displayed in console : "Unable to assign QString to QJSValue"
If the function is passed directly (without .toString()), the error becomes "Unable to assign a function to a property of any type other than var."
Shouldn't we support all types supported by QJSValue (like string & function) ?