PDA

View Full Version : action container



ravas
9th February 2016, 19:23
I use a QMap<QString, QAction*> for every action (around 200) in the program, where the key is the action's objectName.
If I was going to have this container be a permanent member of the main window subclass,
is there an obvious choice between QMap, std::map, QHash and std::unordered_map?
The order they are stored doesn't matter.

jefftee
9th February 2016, 20:11
I personally prefer the Qt implementations over the std ones... Since you don't care about ordered retrieval, I'd use QHash in your case.

d_stranz
9th February 2016, 23:13
I personally prefer the std implementations over the Qt ones for portability reasons, but I'd vote with jefftee on this one since what you need it for is anything but portable to a non-Qt app.