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>
commitc1f4f8e626f3d5c2a2d6112e727ae0d15248cf19
parent625c881cc74f2552e211b9ba81ac3b0ed30e9947
authorMilian Wolff <milian.wolff@kdab.com>
committerThe Qt Project <gerrit-noreply@qt-project.org>
commit timeFri, 10 Jan 2014 14:46:14 +0100