suggestion: foreach (const QString &key, m_objectHandlesMap.keys())

this avoids copying the entire hash if it changes (but obviously includes a cost in that repeated key lookups may or may not be more expensive than iteration, I don't know without doing research)