[Interest] How to expose a ‘index’ property to a delegate?
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Mon Nov 23 16:52:12 CET 2020
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20201123/c6ff82a0/attachment.bin>
More information about the Interest
mailing list