diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2014-01-10 11:38:55 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-10 14:46:14 +0100 |
commit | c1f4f8e626f3d5c2a2d6112e727ae0d15248cf19 (patch) | |
tree | c55947e57e2aedd808420cab8e5676b98baca5b2 /src/imports/webchannel/qmlwebchannelattached.h | |
parent | 625c881cc74f2552e211b9ba81ac3b0ed30e9947 (diff) | |
download | qtwebchannel-c1f4f8e626f3d5c2a2d6112e727ae0d15248cf19.tar.gz |
Properly convert JSON data to target type of function parameter.
This used to work but broke in one of the last few commits apparently.
Now we add a proper unit test to ensure it stays working.
The issue was that JSON only knows e.g. numeric types stored as double.
When we then try to call a method taking an int with the VariantArgument
that tries to convert the double to int, we failed and produced an
invalid QVariant which then converts to 0.
Now we use the appropriate API to convert the JSON data to the correct
target type before calling the method. Furthermore, it became clear
that we can greatly cleanup the VariantArgument thanks to that. It now
is reduced to just a QVariant wrapper class with an implicit cast
operator to QGenericArgument.
Change-Id: Ieaf60f548ea9584e7d760f9cd935da455787f376
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports/webchannel/qmlwebchannelattached.h')
0 files changed, 0 insertions, 0 deletions