> By the way, conversions through QVariant are *exactly* what I implemented
in
> the examples/corelib/serialization/convert tool.
Right, I've seen these to be helpful.
The global task would allow to code like this.
~
struct MyStruct
{
int property1;
QString property2;
};
class MyObject
{
Q_OBJECT
...
public slots:
void mySlot(const QList<MyStruct>& value);
}
QJsonDocument doc(...);
QMetaMethod mySlot(...);
JsonDeserializer deserializer;
QVariant parameter;
if(deserializer.deserialize(doc, mySlot.paremeterType(0), parameter)
invoke(...);
else
{
//error
}
~
The only difference from examples, is that library user specifies, what
datatype should be produced. This would alllow to significantly reduce the
amount of boilerplate code.
_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development