ClangTools: Use qAsConst with non-const Qt containers in range-loops

Change-Id: Id9df0a27c4bcba57ee76574e32ca53cb6c28a43d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Alessandro Portale
2021-02-16 20:44:17 +01:00
parent d6574a6e5f
commit e4f260d544
8 changed files with 14 additions and 14 deletions

View File

@@ -204,7 +204,7 @@ void ClangToolsProjectSettings::store()
map.insert(SETTINGS_KEY_SELECTED_FILES, files);
QVariantList list;
for (const SuppressedDiagnostic &diag : m_suppressedDiagnostics) {
for (const SuppressedDiagnostic &diag : qAsConst(m_suppressedDiagnostics)) {
QVariantMap diagMap;
diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_FILEPATH, diag.filePath.toString());
diagMap.insert(SETTINGS_KEY_SUPPRESSED_DIAGS_MESSAGE, diag.description);