diff --git a/RedPandaIDE/debugger/debugger.cpp b/RedPandaIDE/debugger/debugger.cpp index a10b5c8e..1ee4db8a 100644 --- a/RedPandaIDE/debugger/debugger.cpp +++ b/RedPandaIDE/debugger/debugger.cpp @@ -2273,8 +2273,9 @@ void RegisterModel::updateNames(const QStringList ®Names) void RegisterModel::updateValues(const QHash registerValues) { - foreach(int row, registerValues.keys()){ - mRegisterValues[row] = registerValues[row]; + for(auto it = registerValues.begin();it!=registerValues.end();++it) { + int row = it.key(); + mRegisterValues[row] = it.value(); } emit dataChanged(createIndex(0,1), createIndex(mRegisterNames.count()-1,1)); diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 896e1d44..76209e3e 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -3508,8 +3508,8 @@ void Editor::showCompletion(const QString& preWord,bool autoComplete, CodeComple } else { switch(calcParserLanguage()) { case ParserLanguage::CPlusPlus: - foreach (const QString& keyword, CppKeywords.keys()) { - keywords.insert(keyword); + for(auto it = CppKeywords.begin();it!=CppKeywords.end();++it) { + keywords.insert(it.key()); } break; case ParserLanguage::C: @@ -3518,8 +3518,8 @@ void Editor::showCompletion(const QString& preWord,bool autoComplete, CodeComple #ifdef ENABLE_SDCC case ParserLanguage::SDCC: keywords = CKeywords; - foreach (const QString& keyword, SDCCKeywords.keys()) { - keywords.insert(keyword); + for(auto it = SDCCKeywords.begin();it!=SDCCKeywords.end();++it) { + keywords.insert(it.key()); } break; #endif @@ -5398,8 +5398,8 @@ void Editor::applySettings() #ifdef ENABLE_SDCC if (!inProject() && pSettings->compilerSets().defaultSet() && pSettings->compilerSets().defaultSet()->compilerType()==CompilerType::SDCC) { - foreach(const QString& s, SDCCKeywords.keys()) - set.insert(s); + for(auto it=SDCCKeywords.begin();it!=SDCCKeywords.end();++it) + set.insert(it.key()); } #endif ((QSynedit::CppSyntaxer*)(syntaxer().get()))->setCustomTypeKeywords(set); diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 7cc6e741..3d745e21 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -5926,9 +5926,9 @@ void CppParser::internalInvalidateFile(const QString &fileName) } //remove all statements from namespace cache - const QList& keys=mNamespaces.keys(); - for (const QString& key:keys) { - PStatementList statements = mNamespaces.value(key); + for (auto it=mNamespaces.begin();it!=mNamespaces.end();++it) { + QString key = it.key(); + PStatementList statements = it.value(); for (int i=statements->size()-1;i>=0;i--) { PStatement statement = statements->at(i); if (statement->fileName == fileName) { diff --git a/RedPandaIDE/parser/parserutils.cpp b/RedPandaIDE/parser/parserutils.cpp index 6bcafd08..eba90a2b 100644 --- a/RedPandaIDE/parser/parserutils.cpp +++ b/RedPandaIDE/parser/parserutils.cpp @@ -781,7 +781,8 @@ void ParsedFileInfo::insertBranch(int level, bool branchTrue) bool ParsedFileInfo::isLineVisible(int line) const { int lastI=-1; - foreach(int i,mBranches.keys()) { + for(auto it=mBranches.begin();it!=mBranches.end();++it) { + int i = it.key(); if (line