[Development] Property bindings in Qt 6

Ville Voutilainen ville.voutilainen at gmail.com
Mon Sep 30 18:38:56 CEST 2019


On Mon, 30 Sep 2019 at 19:12, Matthew Woehlke <mwoehlke.floss at gmail.com> wrote:

> >     QProperty<QString> fullname;
> >     fullname.setBinding([&]() { return surname() + " " + lastname(); });
>
> I suppose this is convenient, but it also means creating a new function
> object for *every instance of the type*. A more "traditional" approach
> would only have *one* member function (that is called with the implicit
> 'this' parameter).
>
> Have you at least considered doing something similar here, i.e. instead
> of using a capturing lambda, instead use a stateless function that takes
> the owning class as a parameter?

Which owning class? How does that avoid making it a template anyway?


More information about the Development mailing list