[Development] QVariant container API

Ulf Hermann ulf.hermann at qt.io
Mon Mar 23 09:43:29 CET 2020


Hi,

We have the same problem in QML: We want to support user-defined 
containers as transparently as possible, with as little "registration" 
overhead as possible. Currently there is a fixed set of pre-defined 
containers you pass between QML and C++ code. See [1] for the relevant 
rant. I've been experimenting with a QML variant of container meta types 
[2], but I haven't gotten very far, yet. I also haven't looked into the 
code suggested by Vasily, yet.

I'm pretty sure we cannot just remove QSequentialIterable and 
QAssociativeIterable in Qt6. That would be too much of a source 
compatibility break, especially since we haven't deprecated them in Qt5. 
Any solution to container meta types needs to retain those two classes 
as compatibility wrappers.

[1] https://bugreports.qt.io/browse/QTBUG-71574
[2] https://codereview.qt-project.org/c/qt/qtdeclarative/+/284171

Ulf


More information about the Development mailing list