On Mon, Jan 2, 2017 at 4:02 PM, René J.V. Bertin <rjvber...@gmail.com> wrote: > > QMap<MyEnum,QString> dict = { {Enum1, QStringLiteral("Enum1")}, {Enum2, > QStringLiteral("Enum2")} }; >
As a side note, if your enums are sequential and starting from 0, as most are, my advice is not to use QMap (a static array should serve you perfectly fine). It would mean the binary tree to be degenerate, and ultimately you'd get a rebalancing with each insert.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest