[Interest] QQmlPropertyList x QList in hybrid C++/QML APIs

Alan Alpert 416365416c at gmail.com
Mon Jun 17 21:27:25 CEST 2013

On Sun, Jun 16, 2013 at 2:27 AM, Stephen Kelly <stephen.kelly at kdab.com> wrote:
> On Friday, June 14, 2013 16:43:12 Sandro Andrade wrote:
>> Am I missing something ?
> The QML engine doesn't use the QVariant API for accessing things in a
> QVariant. So capabilities you have when using QVariant/Q_PROPERTY are not
> available in QML. This is probably fixable, but I'm not sure it's understood
> by the people who know QML well enough to fix it.

I can't find the task for it, which might be needed in order to fix it
;). When the engine internals finish being re-written again we'll have
a chance to fix it, so raise a task if it's not there.

I don't think the problem though would be that we're not using the
QVariant API (I think it's correct to leave it as a variant), it's
that QList<QObject*> is mapping to QVariant(QObjectList) in script
instead of array<Object>. QObjectList would be reasonable to deal with
specially for the read-only case, we just need to be able to block
writing to it (because for a writable list you should be using

It could be that last caveat which has been blocking implementation
for so long. Maybe even with V4 the change will be impractical to
implement, but it's worth checking out.

Alan Alpert

More information about the Interest mailing list