Getting data from a lot of QMaps into one QMap.
recently I got an strange (for me) error by my project. Idea is: from a couple of QMaps I need to retrieve data and put into one QMap.
I wrote this piece of code: (getKeywords() returns a QMap<QString, unsigned>)
- for(int i = 0; i < this->first->getLogsNumber(); i++)
- j != this->first->getPool().at(i)->getKeywords().end(); j++)
- total_of_first[ j.key() ] += j.value();
- total_of_first.insert(j.key(), j.value()); // I found out that problem is here, but actually I don't know why
Could anyone give me a tip how to resolve this problem? I’ll be very glad for all hints.