[Interest] [Qt6] Inject a QML enum from C++ at runtime

Konstantin Shegunov kshegunov at gmail.com
Thu Jan 20 16:04:10 CET 2022


On Thu, Jan 20, 2022 at 4:55 PM Ulf Hermann <ulf.hermann at qt.io> wrote:

> Why does it have to be an enumerator?


It doesn't, of course. Currently I'm simply using strings instead. However
it's 'nice' for the QML person/people to refer to a real name with an
integer behind instead of a free-floating string, albeit you could make the
argument that it's the same either way.


> The code accessing them needs to know a fixed set of names after all.
>

Well, the number of names isn't fixed is the point - they're loaded at
runtime and will change (increase) from time to time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220120/0236cca0/attachment.htm>


More information about the Interest mailing list