[Development] QVariant container API

Vasily Pupkin shkodindanil.letmework at gmail.com
Wed Apr 3 10:47:38 CEST 2019


>  Using QVariant as an intermediate data structure is not optimal to
read/write your QList<MyStruct>
>  It also prevents from directly using the QList<MyStruct> type to guide
the deserialization. In QBind you do not need to register types at runtime
and you avoid losing data silently (instead you have static_asserts
complaining at compile time).

The whole idea, is to provide (de)serialization mechanism in scenarios,
when one cannot know the type staticaly, but can get it dynamicaly in a
statically typed language. In general one has to provide a void pointer and
type enumeration. But Qt already happens to have rich type information,
while C++ trails a bit. And that is QVariant+QMetaType.

The only thing in cannot do right now is operating on containers. And
that's what I wanted to discuss.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190403/e56671a2/attachment-0001.html>


More information about the Development mailing list