QMultiMap strange behavior
_Mark_ last edited by
Please, look at this code:
QMultiMap<QString, int> map;
QList<int> values = map.values("a"); //qDebug() << values.size(); for (int i = 0; i < values.size(); i++) qDebug() << values.at(i);
With qDebug() << values.size() commented it prints out only the first value of the key "a".
If I enable the qDebug() of the values.size() it prints out both values!
Qt5.3 under linux arm (RPi).
On OS X with 5.4, it works as expected
andre last edited by
I don't see why it would not work, but if it doesn't, it seems to me the problem would be in QList, not in QMultiMap right? However, due to the very core nature of QList and the fact that it is used everywhere, I find it extremely unlikely that it would faulty in such basic behaviour. More likely something a clean complile would solve, I think.