From bec50124b893c4632829d9806f49f64c4debf936 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 25 May 2016 18:20:30 +0200 Subject: Fix setting properties of QJson{Value,Array,Object} type. Similar to the previous issue, where these types were not properly converted to QVariant when invoking a method, we manually do the conversion now to get the desired behavior. The culprit is again that QJsonValue::toVariant converts an object e.g. to a QVariantMap, and not to a QVariant containing a QJsonObject. [ChangeLog] QObject properties of type QJsonValue, QJsonArray or QJsonObject can now be set via the Qt WebChannel. Task-number: QTBUG-48198 Change-Id: I5d574b1a5cffd6d6ad9b555f2a3e872b9c3425a7 Reviewed-by: Simon Hausmann --- src/webchannel/qmetaobjectpublisher_p.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/webchannel/qmetaobjectpublisher_p.h') diff --git a/src/webchannel/qmetaobjectpublisher_p.h b/src/webchannel/qmetaobjectpublisher_p.h index cb3350e..b0ebd84 100644 --- a/src/webchannel/qmetaobjectpublisher_p.h +++ b/src/webchannel/qmetaobjectpublisher_p.h @@ -149,6 +149,11 @@ public: */ QVariant invokeMethod(QObject *const object, const int methodIndex, const QJsonArray &args); + /** + * Set the value of property @p propertyIndex on @p object to @p value. + */ + void setProperty(QObject *object, const int propertyIndex, const QJsonValue &value); + /** * Callback of the signalHandler which forwards the signal invocation to the webchannel clients. */ -- cgit v1.2.1