[Interest] Qml/qmlllint: coercion / typecasts possible?

Nils Jeisecke nils.jeisecke at saltation.com
Mon Aug 21 18:18:44 CEST 2023


Hi Heiko,

>   you could use
>
>   const index = (clickedItem as Foo).index;
>
> Unfortunately there is BUG#116264 which prevents inline components to be
> used that way but hopefully will be fixed in one of the next Qt-Versions.

> It would work if you put the Foo component into a Foo.qml file.
Yeah, that's what I've found out just a few minutes ago with help from Ivan ;-)

Thanks for mentioning the QTBUG number!

Nils


More information about the Interest mailing list