On Monday January 2 2017 14:36:03 Konstantin Shegunov wrote: >Do you mean something like this? <snip> >It isn't exactly pretty but should work okay.
Yes and no. Behind the scenes the code would of course look much like that, but in user code I was thinking along the lines of QMap<MyEnum,QString> dict = { {Enum1, QStringLiteral("Enum1")}, {Enum2, QStringLiteral("Enum2")} }; I considered what you suggested, of course. Writing such a generic interface makes sense if you can reuse it sufficiently often (or if you have really many entries to add), but rarely if you have just a few small dicts to create here and there. R _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest