diff options
author | Andrew Webster <awebster@arcx.com> | 2018-09-14 11:11:32 -0400 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2019-04-10 08:53:47 +0000 |
commit | d7ece941aebdac1be820fdfe74c273fb963dfcad (patch) | |
tree | 06ea43e8505e22090bab22af588f33a5bf4ab0ce /examples | |
parent | b1908a1f8fa7cd358e830ba774b92452fc7085f9 (diff) | |
download | qtwebchannel-d7ece941aebdac1be820fdfe74c273fb963dfcad.tar.gz |
Unwrap property updates in case they are QObjects
When an object is initialized, QObject properties are properly
unwrapped. However, before this patch, updates made to QObject
properties were not unwrapped and thus could not be used from
ECMAScript.
For example, given a property defined as such:
Q_PROPERTY(QObject* theProp READ theProp NOTIFY thePropChanged)
The property "theProp" is correctly unwrapped when the parent
object is created. However, it would not have been unwrapped
when "thePropChanged" is emitted. This patch corrects that.
Change-Id: If8f67560d9fb2a4bd909d2ab30305ceab30f8d31
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/webchannel/shared/qwebchannel.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/webchannel/shared/qwebchannel.js b/examples/webchannel/shared/qwebchannel.js index 9108a61..6cc3690 100644 --- a/examples/webchannel/shared/qwebchannel.js +++ b/examples/webchannel/shared/qwebchannel.js @@ -320,7 +320,7 @@ function QObject(name, data, webChannel) // update property cache for (var propertyIndex in propertyMap) { var propertyValue = propertyMap[propertyIndex]; - object.__propertyCache__[propertyIndex] = propertyValue; + object.__propertyCache__[propertyIndex] = this.unwrapQObject(propertyValue); } for (var signalName in signals) { |