Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Why QHash::iterator's operator+() was declared obsolet in 5.15?
Kofr last edited by
And how to substitute correctly?
Bonnie last edited by Bonnie
You can check the documentation yourself:
This operator is deprecated in order to align with std::unordered_map functionality.
So I don't think there is any substitution since this function is removed on purpose.
I think they just want to disable all the "backward" iterating functions of QHash (operator+() accepts negative values).
You can use QMap instead, or calling operator++() multiple times, as what operator+() with a positive value actually does..
The function simply makes no sense - QHash is unordered so what do you want from this operator?