[Qt-qml] Models inside models

Stephen Kelly steveire at gmail.com
Thu Mar 24 16:37:24 CET 2011


Pelle Johnsen wrote:

>>
>> Yes. I'm not sure if it can be done while using a QAbstractItemModel
>> as the root model because the returned values are QVariants (right?),
>>
> 
> If your innerModel type is registered (Q_DECLARE_METATYPE or
> QML_DECLARE_TYPE) you can pass it out as QVariant.

Which is unfortunately not useful because QML can't extract it as a QObject.

http://steveire.wordpress.com/2011/03/16/implementing-qvariantqmetatype-
features-with-template-tricks/

My solution isn't going to work out in the end though unfortunately.

You can still put the model in as a QObject though and you might have better 
luck.

> 
>  -Pelle




More information about the Qt-qml mailing list