diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index 03c0a538a6..73b98190a7 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -353,8 +353,11 @@ void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableF { const auto locker = qt_scoped_lock(registryMutex); - if (!categories.contains(cat)) { - categories.insert(cat, enableForLevel); + const auto oldSize = categories.size(); + auto &e = categories[cat]; + if (categories.size() != oldSize) { + // new entry + e = enableForLevel; (*categoryFilter)(cat); } }