[Interest] How to expose a ‘index’ property to a delegate?
Nicolas Ulrich
nikolaseu at gmail.com
Mon Nov 23 21:33:22 CET 2020
I had a similar issue a long time ago and I didn't want to spend much
time so I used an ugly workaround. I'm interested in the proper
solution, but this works https://github.com/fferri/qt3d-thing/pull/1
I think Qt 3d needs a proper "Loader" (so you can do something like
this https://doc.qt.io/qt-5/qml-qtquick-loader.html#using-a-loader-within-a-view-delegate)
instead of reusing NodeInstantiator.
Nicolás
On Mon, Nov 23, 2020 at 7:18 PM Federico Ferri
<federico.ferri.it at gmail.com> wrote:
>
> I pushed these files and the QtC project to https://github.com/fferri/qt3d-thing
>
> On 23 November 2020 at 17:49:17, Federico Ferri (federico.ferri.it at gmail.com) wrote:
>
> Following your advice, I changed Array.qml to the following: (most notably: added the repeater.model property alias)
>
> […]
>
>
> Cheers,
> Federico Ferri
>
> On 23 November 2020 at 16:53:37, Giuseppe D'Angelo via Interest (interest at qt-project.org) wrote:
>
> Il 23/11/20 14:20, Federico Ferri ha scritto:
> >
> > but of course in this example it is using a non-existent ‘index’ in the
> > PhongMaterial.diffuse binding.
>
> Are you sure it's non-existing? The context in which that delegate is
> going to be created should have "index" injected into it.
>
> Needless to say, all of this is deprecated in 5.15 (in favour of
> required properties), and even before you were never supposed to use
> unqualified properties like those. You were supposed to
>
> 1) always prefix them with model.
> 2) expose properties on the root of the delegate, use them internally as
> needed, and bind them when using the delegate in a view.
>
> See > https://youtu.be/vzs5VPTf4QQ?t=2240
>
> HTH,
>
> --
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
More information about the Interest
mailing list