Qt 6.11 is out! See what's new in the release
blog
QHash remove item while iterating?
-
I'm interating through a QHash and I want to modify the key of an item as I find it.
e.g.if (i.key() == 123) then { // remove this item to reinsert later with a key of 456 }However can I remove the item during the iteration?
Or better yet, is there a way to modify the key on the fly without doing a remove+insert? -
I'm interating through a QHash and I want to modify the key of an item as I find it.
e.g.if (i.key() == 123) then { // remove this item to reinsert later with a key of 456 }However can I remove the item during the iteration?
Or better yet, is there a way to modify the key on the fly without doing a remove+insert?@Publicnamer It's all in the documentation: https://doc.qt.io/qt-5/qhash.html#erase