[Development] QProperty and library coding guide

Stottlemyer, Brett (B.S.) bstottle at ford.com
Fri Jul 17 14:12:16 CEST 2020


Hi,

> item->width.setBinding([]() { return otherItem->height(); });
...
> item->widthSetBinding([]() { return otherItem->height(); });
...
> See the definition of Q_PRIVATE_QPROPERTY for the different methods we
generate into the structs.

It sounds like there are two overlapping elements to these changes.  First is the ability to compress getters/setters/onChanged in to a single name, and second, an extension to allow "lazy" binding?  Is this correct?  I understand the struct would allow both, I'm asking about the intent, not the implementation.  I.e., how this is expected to be used.

>From the above, it looks like "lazy" binding (is there a better name:?) could be enabled without the P_PRIVATE_QPROPERTY macro using a separate name, right?  Is there a canonical use-case/example available yet?

I know most of you are focused on the implementation and compatibility, but I'm still unclear on what the impact to the user is, especially for the "lazy" binding...

Thanks,
Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200717/872f0e88/attachment-0001.html>


More information about the Development mailing list