[Interest] initialising a dictionary-type container instance with a static table?

René J.V. Bertin rjvbertin at gmail.com
Mon Jan 2 13:02:12 CET 2017


I must be overlooking or even forgetting something: is there a way to initialise a QMap or QHash instance with a static table, say when you're creating a fast lookup dictionary mapping enums or preprocessor tokens to a QString?

That's information known a compile time so I was expecting to be able to avoid adding each mapping explicitly with a sequence of

map[token] = "token";

statements. If that's indeed possible, the documentation doesn't really showcase it.



More information about the Interest mailing list