[Interest] Qml Attached properties list inheritance

Jérôme Godbout jerome at bodycad.com
Mon Nov 7 21:05:03 CET 2016


Hi,
I would like to know if this is possible to make inherited attached
properties into Qml declaration append to a list of items.

Example:

*file A.qml*

Item
{
  AttachmentClass.myList: ['w', 'x', 'z']
}

*file B.qml*
A
{
   AttachmentClass.myList: ['t', 'u']
}

I would like to know if it's possible to have
AttachmentClass.myList = ['w', 'x', 'z', 't', 'u']
instead of the current
AttachmentClass.myList = ['t', 'u'] // base class component attachee entry
are overrided, normal and await

I know it sound weird, but I would like to collect all inhereted elements
into the attachee. Probably impossible just wondering if anybody have a
clue of how to do it elegantly?

The only thing I see is to concat by signal/slots and assign the results,
this make it weird syntax. Something like this for file B.qml:

A
{
  Component.onCompleted:
  {
     AttachmentClass.myList = ['t', 'u'].concat(AttachmentClass.myList)
  }
}

This does work, but I found it pretty ugly and it's not assigned until
component is completed. On top of it, B need to konwn that A did make an
attached properties to use it, which is what I try to avoid.

Any though on this?

Thanks,
jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161107/64c78adc/attachment.html>


More information about the Interest mailing list