QMap::findValue
Posted: Fri Sep 09 2022 3:59 pm
This is something that has been needed since QMap was originally conceived. There must literally be tens of thousands of programs that have code much like the following:
Really need a findValue() that operates like find()
https://www.copperspice.com/docs/cs_api/class_qmap.html#a10fa252c264c8b8aa4d8d374cddd6289
Code: Select all
QString retVal;
bool foundFlg = false;
QMapIterator<QString, int> iter(map);
while (iter.hasNext() && !foundFlg)
{
iter.next();
if (iter.value() == valueImLookingFor)
{
retVal = iter.key();
foundFlg = true;
}
}
https://www.copperspice.com/docs/cs_api/class_qmap.html#a10fa252c264c8b8aa4d8d374cddd6289