Unwrap QObjects embedded inside arguments


This converts QObjects that are embedded inside ECMAScript objects
into the actual QObject that they represent.

For example, if an array of QObjects is passed as an argument to
a method, the method will received a QVariantList where the
items are QVariants of type QObjectStar.

Method:

  void processObjects(const QVariantList &list);

Call from ECMAScript:

  theObj.processObjects([qobj1, qobj2])

Prior to this patch, the method would have received a list
containing QVariantMaps with keys from the QObject EMCAScript wrapper
(e.g. __objectSignals__, __propertyCache__, etc.).

After this patch, it will receive a list containing QVariants with
QObject* inside.

QVariantMaps are converted to QObjects if they have a property
called "__QObject*__" set to true and an "id" property.
"__QObject*__" is the same identifier for retuned objects and is
now added in a toJSON method at the client.

Change-Id: I5cafcddb9df0141977a574aaed4ce7c3ea2d0767
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
commite535b24adf28ad6f0a93b7ecb37fccbef3a5d016
parent26fbc4038223f5571dd048c1d800458708b6972c
authorAndrew Webster <awebster@arcx.com>
committerAndrew Webster <awebster@arcx.com>
commit timeFri, 20 Sep 2019 08:33:52 -0400