[Interest] Meta type automatic registration and QList in QML
trollixx at gmail.com
Mon Nov 19 01:35:35 CET 2012
I found that now new types in Q_PROPERTY should be registered automatically
In my application I need to pass QList<QRect> as an object property. Now I
use QVariantList because my code has been just ported from Qt4 to Qt5. I
have tried to use QList<QRect> instead of QVariantList but got the
QMetaProperty::read: Unable to handle unregistered datatype 'QList<QRect>'
for property 'Article::rects'
Adding qRegisterMetaType<QList<QPoint>>("QList<QPoint>"); fixed the error
message but anyway I cannot iterate through a list or get its length. This
property shows like QVariant(QList<QRect>) in console.log().
Is there a way to handle QList<QRect> natively in Qt5's QML without awful
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest