Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Deserialization QPair within QVariant #36

Open
arietto opened this issue Apr 30, 2020 · 0 comments
Open

Deserialization QPair within QVariant #36

arietto opened this issue Apr 30, 2020 · 0 comments

Comments

@arietto
Copy link

arietto commented Apr 30, 2020

Hello!
I have QVariant field1 within Q_GADGET (JSON serialization). This field contain QPair<int,int> (for example). field1 can contain some gadgets, each one is linked with Gadget_type enum. Gadget contains Gadget_type field2 (enum which depicts actual data type).
I've added all typical metatype registration stuff, including QMetaType::registerConverter. The result field value is in quotes: "field1":"[1,2]". The problem is linked with deserialization exception:

Failed to deserialize with error: Failed to convert deserialized variant of type QString to property type QVariant. Make shure to register converters with the QJsonSerializer::register* methods.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant