Hi,

I'm trying to do some introspection of generic QObject-derived classes where I 
essentially iterate over all the properties and serialize their values into a 
hashmap or json-like tree structure. I'm using the QMetaObject class to get the 
names of all properties and their values as QVariants, then checking 
canConvert() in a switch statement to identify the type and serialize 
accordingly. This works for pretty much any primitive type, most basic 
container types and works recursively for QObject-based types as well. However, 
when I'm stuck when it comes to handling a property type of QQmlListProperty<T> 
(where T is not necessarily known, but it can be assumed to be derived from 
QObject). 

Is there a way to convert a QVariant that contains a QQmlListProperty<T> into a 
QVariantList? .canConvert<QVariantList>() does not seem to work in this case.

Brian
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to