[Webkit-unassigned] [Bug 104540] [Qt] JS bridge does not transmit QVariants anymore in Qt5

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 13 00:20:15 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=104540


Michael Brüning <michael.bruning at digia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|webkit-unassigned at lists.web |michael.bruning at digia.com
                   |kit.org                     |




--- Comment #6 from Michael Brüning <michael.bruning at digia.com>  2012-12-13 00:22:37 PST ---
(In reply to comment #5)
> I can give the temporary workaround a try. HOWEVER, the problem already occured when expecting the QVariant as parmeter -- without converting it to a QVariantMap afterwards. The QVariantMap conversion just made the problem more obvious (see my comment #2, I hope that comment was clear enough).

Your comment was clear enough, no worries :). 
Actually, expecting a QVariant parameter in the signature of the slot when a QVariantMap is being returned is what makes it not work. Whatever happens to that  QVariant in the slot afterwards is not really relevant, as the corruption / conversion error from QVariantMap to QVariant occurs inside the JS bridge code before the slot is even called. 

So when returning a JSON object through the bridge, this:

void MyObject::slotHandleJSONObject(QVariantMap map) // okay, no conversion from QVariantMap to QVariant
{
   // process data from map
   ...
}

would work, while this:

void MyObject::slotHandleJSONObject(QVariant variant) // corrupted by the conversion from QVariantMap to QVariant inside the JS bridge
{
   QVariantMap map = variant.topMap(); // contains corrupted data
}

Anyway, this needs to be fixed within the JS bridge / Qt, the solution outlined above is just for temporarily making it work until that fix rolls in...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list